Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-35939: rpl.rpl_parallel_sbm: "Slave_last_event_time is not equal…
… to Master_last_event_time" The test rpl.rpl_parallel_sbm would fail because Slave_last_event_time would not match Master_last_event_time after syncing with the master (i.e. via sync_with_master_gtid.inc). This happens because the timing statistics are updated after updating gtid_slave_pos. That is, gtid_slave_pos is updated with the transaction commit, whereas the timing statistics are updated when the relay log position is updated (i.e. after the commit). This is by design. For the test, this means there is a small amount of time after sync_with_master_gtid.inc where the SHOW SLAVE STATUS output lags behind the data state of the slave. This would cause the test to fail if comparing Slave_last_event_time to Master_last_event_time during this period, because Slave_last_event_time would not yet reflect the latest committed transaction. The fix is to add a wait_condition before the comparison to wait for the SHOW SLAVE STATUS statistics to be updated. The actual check is to wait for Seconds_Behind_Master == 0, because the slave should be idle at this point, which forces the value to be 0. The test failure can be reproduced with the following patch: diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index db5c26b6237..b346a32b573 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -300,6 +300,7 @@ rpl_slave_state::update(uint32 domain_id, uint32 server_id, uint64 sub_id, mysql_mutex_lock(&LOCK_slave_state); res= update_nolock(domain_id, server_id, sub_id, seq_no, hton, rgi); mysql_mutex_unlock(&LOCK_slave_state); + sleep(1); return res; }
- Loading branch information