mirror of
https://github.com/MariaDB/server.git
synced 2025-06-25 06:01:23 +02:00

Fix some random test failures following MDEV-32168 push. Don't blindly set $rpl_only_running_threads in many places. Instead explicit stop only the IO or SQL thread, as appropriate. Setting it interfered with rpl_end.inc in some cases. Rather than clearing it afterwards, better to not set it at all when it is not needed, removing ambiguity in the test about the state of the replication threads. Don't fail the test if include/stop_slave_io.inc finds an error in the IO thread after stop. Such errors can be simply because slave stop happened in the middle of the IO thread's initial communication with the master. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
69 lines
2.2 KiB
PHP
69 lines
2.2 KiB
PHP
--connection master
|
|
create table t1 (a int) engine=innodb;
|
|
create table t2 (a int) engine=innodb;
|
|
insert into t1 values (1);
|
|
--source include/save_master_gtid.inc
|
|
|
|
--connection slave
|
|
call mtr.add_suppression("Slave: Commit failed due to failure of an earlier commit on which this one depends");
|
|
|
|
--source include/sync_with_master_gtid.inc
|
|
--source include/stop_slave.inc
|
|
set @save.slave_parallel_threads= @@global.slave_parallel_threads;
|
|
set @save.slave_parallel_mode= @@global.slave_parallel_mode;
|
|
set @@global.slave_parallel_threads= 3;
|
|
set @@global.slave_parallel_mode= CONSERVATIVE;
|
|
--connection slave1
|
|
BEGIN;
|
|
update t1 set a=2 where a=1;
|
|
|
|
--connection master
|
|
SET @old_dbug= @@SESSION.debug_dbug;
|
|
SET @@SESSION.debug_dbug="+d,binlog_force_commit_id";
|
|
|
|
# GCO 1
|
|
SET @commit_id= 10000;
|
|
# T1
|
|
update t1 set a=2 where a=1;
|
|
# T2
|
|
insert into t2 values (1);
|
|
|
|
# GCO 2
|
|
SET @commit_id= 10001;
|
|
# T3
|
|
insert into t1 values (3);
|
|
|
|
--connection slave
|
|
--source include/start_slave.inc
|
|
|
|
# Wildcard for `state` as it depends on whether WSREP is compiled in or not.
|
|
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(%)' and command LIKE 'Slave_worker';
|
|
--source include/wait_condition.inc
|
|
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit%' and command LIKE 'Slave_worker';
|
|
--source include/wait_condition.inc
|
|
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to start commit%' and command LIKE 'Slave_worker';
|
|
--source include/wait_condition.inc
|
|
|
|
--let $t3_tid= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for prior transaction to start commit%'`
|
|
--evalp kill $t3_tid
|
|
|
|
--connection slave1
|
|
commit;
|
|
|
|
--connection slave
|
|
--let $slave_sql_errno=1032
|
|
--source include/wait_for_slave_sql_error.inc
|
|
|
|
update t1 set a=1 where a=2;
|
|
set @@global.slave_parallel_threads = @save.slave_parallel_threads;
|
|
set @@global.slave_parallel_mode = @save.slave_parallel_mode;
|
|
--source include/start_slave.inc
|
|
|
|
--echo #
|
|
--echo # Cleanup
|
|
--connection master
|
|
DROP TABLE t1, t2;
|
|
--source include/save_master_gtid.inc
|
|
|
|
--connection slave
|
|
--source include/sync_with_master_gtid.inc
|