diff options
author | Sujatha <sujatha.sivakumar@mariadb.com> | 2021-08-16 12:25:52 +0530 |
---|---|---|
committer | Sujatha <sujatha.sivakumar@mariadb.com> | 2021-08-19 11:59:39 +0530 |
commit | 475f69b98587c2a0842e3fcbfe515e4362ded973 (patch) | |
tree | 4aaf096c4ca57ec0e0eedf8c96e9173078c27263 /sql/log.cc | |
parent | 583516bbb9c14f82866942e4cc159edfdc3a1bfa (diff) | |
download | mariadb-git-475f69b98587c2a0842e3fcbfe515e4362ded973.tar.gz |
MDEV-25958: rpl_semi_sync_fail_over.test fails in buildbot
Analysis:
========
In case multi binlog truncation scenario debug sync points are in the
following order.
Two inserts are done on master as shown below.
INSERT INTO t1 VALUES (4, REPEAT("x", 4100)
commit_after_release_LOCK_after_binlog_sync
INSERT INTO t1 VALUES (5, REPEAT("x", 4100)
commit_after_release_LOCK_log
First insert debug sync ensures that transaction is synced to binlog and
not committed but it reached slave through semi sync.
Second insert debug sync ensures that transaction is synced to binlog and
not committed. It doesn't ensure that 'INSERT 5' reached slave.
Most of the times INSERT 5 reaches slave, hence when it is promoted as
master it sends 4,5 to slave. But occasionally 5 may not reach slave in
those cases post recovery master will have only 4. When row 6 is inserted
Master has 4-6 and Slave has 4,5,6.
This results in test failure.
Fix:
===
For the first insert use 'commit_before_get_LOCK_commit_ordered' debug sync
point, it will ensure that binlog was sent to slave and slave has
acknowledged the receipt. Now enable debug code such that when the next
transaction is written to binary log, dump thread will read and send it
across the network and notify the server to be get killed. Insert row 5
and wait for notification from dump thread. Kill the server. This ensures
that both 4 and 5 have reached the semi-sync slave.
Added a new test case:
Insert two rows on master such that first is present in master's binlog and
reached semi sync slave. Second insert should be flushed to binlog but not
sent to slave. Now crash and fail over to slave. The promoted master will send
the extra transaction to slave.
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc index 2ab5bc31cda..d228cf697dd 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -8316,6 +8316,7 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader) } else { + DEBUG_SYNC(leader->thd, "commit_before_update_binlog_end_pos"); bool any_error= false; mysql_mutex_assert_not_owner(&LOCK_prepare_ordered); |