From 3030799ae18829bd7236db6896eed1e6a55f6586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 1 May 2018 10:03:01 +0300 Subject: [PATCH] Fix GTID updating for slaves The updating of GTIDs was only considered successful if both the current GTID position and binlog GTID positions were non-empty. If a slave has no binlogged events, the GTID update would always fail. This change in behavior caused the mysqlmon_failover_auto and mysqlmon_failver_manual tests to break. The test disabled the binary log on one of the servers which caused it to be left out from the rejoining process. --- server/modules/monitor/mariadbmon/mariadbserver.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/modules/monitor/mariadbmon/mariadbserver.cc b/server/modules/monitor/mariadbmon/mariadbserver.cc index 4efac9a6a..e1e99810f 100644 --- a/server/modules/monitor/mariadbmon/mariadbserver.cc +++ b/server/modules/monitor/mariadbmon/mariadbserver.cc @@ -215,7 +215,6 @@ bool MariaDBServer::update_gtids() auto current_str = result->get_string(i_current_pos); auto binlog_str = result->get_string(i_binlog_pos); bool current_ok = false; - bool binlog_ok = false; if (current_str.empty()) { m_gtid_current_pos = GtidList(); @@ -233,10 +232,9 @@ bool MariaDBServer::update_gtids() else { m_gtid_binlog_pos = GtidList::from_string(binlog_str); - binlog_ok = !m_gtid_binlog_pos.empty(); } - rval = (current_ok && binlog_ok); + rval = current_ok; } return rval; }