From b10fc196a15eb6b360d6c0a7aaa9efb1aec620a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 10 May 2019 10:52:23 +0300 Subject: [PATCH 1/3] Fix maxinfo/maxadmin debug assertion Both services could write to a DCB from a worker that doesn't own it. --- .../modules/protocol/MySQL/mariadbclient/mysql_client.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc index 68f87612f..a68f748b4 100644 --- a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc +++ b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc @@ -1475,7 +1475,13 @@ static void gw_process_one_new_client(DCB* client_dcb) } else { - MySQLSendHandshake(client_dcb); + // It's possible that the DCB isn't owned by the chosen worker if it's a + // maxadmin/maxinfo service. In this case the execution must be moved to the + // owning worker. + auto worker = static_cast(client_dcb->poll.owner); + worker->execute([=]() { + MySQLSendHandshake(client_dcb); + }, mxs::RoutingWorker::EXECUTE_AUTO); } }, mxs::RoutingWorker::EXECUTE_AUTO); } From 79cfd7183df54db1c73ac02d5e34d0a8fa462599 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 13 May 2019 09:42:45 +0300 Subject: [PATCH 2/3] MXS-2475 Fix mxs1980_blr_galera_server_ids test At some point the replicating slave had been changed to be a Galera node. Won't work as the Galera node is a master. --- maxscale-system-test/CMakeLists.txt | 2 +- maxscale-system-test/mxs1980_blr_galera_server_ids.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maxscale-system-test/CMakeLists.txt b/maxscale-system-test/CMakeLists.txt index 0a8a4b75f..6c2c4fff6 100644 --- a/maxscale-system-test/CMakeLists.txt +++ b/maxscale-system-test/CMakeLists.txt @@ -362,7 +362,7 @@ add_test_executable(pers_01.cpp pers_01 pers_01 LABELS maxscale REPL_BACKEND rea # MXS-1980: Support Galera cluster nodes as masters for Binlog Router # https://jira.mariadb.org/browse/MXS-1980 -add_test_executable(mxs1980_blr_galera_server_ids.cpp mxs1980_blr_galera_server_ids mxs1980_blr_galera_server_ids LABELS binlogrouter GALERA_BACKEND) +add_test_executable(mxs1980_blr_galera_server_ids.cpp mxs1980_blr_galera_server_ids mxs1980_blr_galera_server_ids LABELS binlogrouter GALERA_BACKEND REPL_BACKEND) ############################################ # END: Galera tests # diff --git a/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp b/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp index 96cd49e67..ad7dc338c 100644 --- a/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp +++ b/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp @@ -488,9 +488,9 @@ int main(int argc, char* argv[]) { if (setup_blr(test, pMaxscale, gtid, approach)) { - int slave_index = test.galera->N - 1; // We use the last slave. + int slave_index = test.repl->N - 1; // We use the last slave. - Mariadb_nodes& ms = *test.galera; + Mariadb_nodes& ms = *test.repl; ms.connect(slave_index); MYSQL* pSlave = ms.nodes[slave_index]; From b7d948db3f466aa16493c05a701ccaba0614bc6c Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 13 May 2019 14:57:47 +0300 Subject: [PATCH 3/3] MXS-2475 Properly setup the Galera nodes --- maxscale-system-test/mxs1980_blr_galera_server_ids.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp b/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp index ad7dc338c..81d6d8b9f 100644 --- a/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp +++ b/maxscale-system-test/mxs1980_blr_galera_server_ids.cpp @@ -285,6 +285,10 @@ void setup_galera(TestConnections& test) for (int i = 0; i < gc.N; ++i) { gc.stash_server_settings(i); + // https://mariadb.com/kb/en/library/using-mariadb-gtids-with-mariadb-galera-cluster/#wsrep-gtid-mode + gc.add_server_setting(i, "wsrep_gtid_mode=ON"); + gc.add_server_setting(i, "wsrep_gtid_domain_id=13"); + gc.add_server_setting(i, "gtid_domain_id=0"); gc.add_server_setting(i, "log_slave_updates=1"); gc.add_server_setting(i, "log_bin=galera-cluster"); }