MDEV-7251: Test failure in rpl.rpl_parallel
There was a race. The test case was expecting the slave to start processing a particular DELETE statement, then the test would stop the slave at this point. But there was missing something to wait until the slave would actually reach this point; thus depending on timing it was possible that the slave would be stopped too early, causing .result file difference. Fixed by adding an appropriate wait to the test case.
This commit is contained in:
parent
1eed274848
commit
5fc2814698
@ -983,7 +983,10 @@ SET GLOBAL slave_parallel_threads=0;
|
||||
SET GLOBAL slave_parallel_threads=10;
|
||||
INSERT INTO t2 VALUES (41);
|
||||
INSERT INTO t2 VALUES (42);
|
||||
SET @old_format= @@binlog_format;
|
||||
SET binlog_format= statement;
|
||||
DELETE FROM t2 WHERE a=40;
|
||||
SET binlog_format= @old_format;
|
||||
INSERT INTO t2 VALUES (43);
|
||||
INSERT INTO t2 VALUES (44);
|
||||
FLUSH LOGS;
|
||||
|
@ -1560,7 +1560,11 @@ SET GLOBAL slave_parallel_threads=10;
|
||||
# Setup some transaction for the slave to replicate.
|
||||
INSERT INTO t2 VALUES (41);
|
||||
INSERT INTO t2 VALUES (42);
|
||||
# Need to log the DELETE in statement format, so we can see it in processlist.
|
||||
SET @old_format= @@binlog_format;
|
||||
SET binlog_format= statement;
|
||||
DELETE FROM t2 WHERE a=40;
|
||||
SET binlog_format= @old_format;
|
||||
INSERT INTO t2 VALUES (43);
|
||||
INSERT INTO t2 VALUES (44);
|
||||
# Force the slave to switch to a new relay log file.
|
||||
@ -1581,6 +1585,11 @@ SELECT * FROM t2 WHERE a=40 FOR UPDATE;
|
||||
--connection server_2
|
||||
--source include/start_slave.inc
|
||||
|
||||
# Wait for a worker thread to start on the DELETE that will be blocked
|
||||
# temporarily by the SELECT FOR UPDATE.
|
||||
--let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state='updating' and info LIKE '%DELETE FROM t2 WHERE a=40%'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# The DBUG injection set above will make the worker thread signal the following
|
||||
# debug_sync when the GTID 0-1-100 has been reached by a worker thread.
|
||||
# Thus, at this point, the SQL driver thread has reached the next
|
||||
|
Loading…
x
Reference in New Issue
Block a user