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.
This commit is contained in:
Markus Mäkelä 2018-05-01 10:03:01 +03:00
parent 8ad3b903f9
commit 3030799ae1
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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;
}