Skip to content

Commit 7ca4e1b

Browse files
committed
PS-9328: Fix sporadic rpl.rpl_backup_locked_by_applier test failures.
Fixed sporadic rpl.rpl_backup_locked_by_applier test failures which were caused by race condition in the test case. Logic of the test assumes that conditional debug sync point in Rpl_applier_reader::purge_applied_logs(), which is used in this test, is supposed to be activated only once, when replication thread reaches it for the first time. The test case waits for this event, runs some commands to check that backup lock can't be taken, and then resumes execution of replication thread. After that it disables this conditional sync point. However, if replication thread manages to reach this sync point for the second time, after test has resumed its execution and right before conditional sync point is disabled, it will wait on sync point until timeout is reached. As result the fact that debug sync point was reached but not handled will be detected during post test case check and cause its failure. We fix this problem by moving disabling conditional sync point before we resume replication thread execution when sync point is reached for the first time. The fix is applied to both 8.0 and 8.4 trees, since they are both affected.
1 parent 646a7cf commit 7ca4e1b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mysql-test/suite/rpl/r/rpl_backup_locked_by_applier.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
2323
#
2424
# Unblock applier
2525
#
26-
SET DEBUG_SYNC = 'now SIGNAL continue_purge_applied_logs_after_backup_lock';
2726
# Removing debug point 'syncpoint_purge_applied_logs_after_backup_lock' from @@GLOBAL.debug
27+
SET DEBUG_SYNC = 'now SIGNAL continue_purge_applied_logs_after_backup_lock';
2828
#
2929
# Wait for replica to process the rest of the binlog
3030
#

mysql-test/suite/rpl/t/rpl_backup_locked_by_applier.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ LOCK INSTANCE FOR BACKUP;
5151
--echo # Unblock applier
5252
--echo #
5353

54-
SET DEBUG_SYNC = 'now SIGNAL continue_purge_applied_logs_after_backup_lock';
55-
5654
--let $debug_point = syncpoint_purge_applied_logs_after_backup_lock
5755
--source include/remove_debug_point.inc
5856

57+
SET DEBUG_SYNC = 'now SIGNAL continue_purge_applied_logs_after_backup_lock';
58+
5959
--echo #
6060
--echo # Wait for replica to process the rest of the binlog
6161
--echo #

0 commit comments

Comments
 (0)