Commit 5fc28146 authored by Kristian Nielsen's avatar Kristian Nielsen

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.
parent 1eed2748
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment