From 219b4422cd774932027b4532ba045a6f55b7f22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 20 Jan 2021 10:23:08 +0200 Subject: [PATCH] Add more output to binlog_change_master Knowing the GTIDs before the MASTER_GTID_WAIT call should help us figure out why it doesn't seem to be working as expected. --- system-test/binlog_change_master_common.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system-test/binlog_change_master_common.cpp b/system-test/binlog_change_master_common.cpp index 0aea2954e..57741d5f9 100644 --- a/system-test/binlog_change_master_common.cpp +++ b/system-test/binlog_change_master_common.cpp @@ -3,6 +3,16 @@ void run_test(TestConnections& test, std::function cb) { + auto dump_gtid = [&](int i) { + std::string slave = get_row(test.repl->nodes[i], "SELECT @@gtid_slave_pos")[0]; + std::string binlog = get_row(test.repl->nodes[i], "SELECT @@gtid_binlog_pos")[0]; + std::string current = get_row(test.repl->nodes[i], "SELECT @@gtid_current_pos")[0]; + + test.tprintf( + "Node %d: @@gtid_slave_pos = '%s', @@gtid_binlog_pos = '%s', @@gtid_current_pos = '%s'", + i, slave.c_str(), binlog.c_str(), current.c_str()); + }; + test.set_timeout(120); test.start_binlog(0); test.repl->connect(); @@ -17,8 +27,10 @@ void run_test(TestConnections& test, std::function cb) // Sync the candidate master std::string binlog_pos = get_row(test.repl->nodes[0], "SELECT @@gtid_binlog_pos")[0]; + dump_gtid(0); execute_query(test.repl->nodes[2], "SELECT MASTER_GTID_WAIT('%s', 120)", binlog_pos.c_str()); execute_query(test.repl->nodes[2], "STOP SLAVE"); + dump_gtid(2); MYSQL* blr = open_conn_no_db(test.maxscales->binlog_port[0], test.maxscales->IP[0], @@ -39,7 +51,9 @@ void run_test(TestConnections& test, std::function cb) // Sync a slave and verify all of the data is replicated binlog_pos = get_row(test.repl->nodes[2], "SELECT @@gtid_binlog_pos")[0]; + dump_gtid(2); execute_query(test.repl->nodes[3], "SELECT MASTER_GTID_WAIT('%s', 120)", binlog_pos.c_str()); + dump_gtid(0); std::string sum = get_row(test.repl->nodes[3], "SELECT COUNT(*) FROM test.t1")[0]; test.expect(sum == "50", "Inserted 50 rows but only %s were replicated", sum.c_str());