| 1 |
--connection master |
| 2 |
create table t1 (a int) engine=innodb; |
| 3 |
create table t2 (a int) engine=innodb; |
| 4 |
insert into t1 values (1); |
| 5 |
--source include/save_master_gtid.inc |
| 6 |
|
| 7 |
--connection slave |
| 8 |
call mtr.add_suppression("Slave: Commit failed due to failure of an earlier commit on which this one depends"); |
| 9 |
|
| 10 |
--source include/sync_with_master_gtid.inc |
| 11 |
--source include/stop_slave.inc |
| 12 |
set @save.slave_parallel_threads= @@global.slave_parallel_threads; |
| 13 |
set @save.slave_parallel_mode= @@global.slave_parallel_mode; |
| 14 |
set @@global.slave_parallel_threads= 3; |
| 15 |
set @@global.slave_parallel_mode= CONSERVATIVE; |
| 16 |
--connection slave1 |
| 17 |
BEGIN; |
| 18 |
update t1 set a=2 where a=1; |
| 19 |
|
| 20 |
--connection master |
| 21 |
SET @old_dbug= @@SESSION.debug_dbug; |
| 22 |
SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; |
| 23 |
|
| 24 |
# GCO 1 |
| 25 |
SET @commit_id= 10000; |
| 26 |
# T1 |
| 27 |
update t1 set a=2 where a=1; |
| 28 |
# T2 |
| 29 |
insert into t2 values (1); |
| 30 |
|
| 31 |
# GCO 2 |
| 32 |
SET @commit_id= 10001; |
| 33 |
# T3 |
| 34 |
insert into t1 values (3); |
| 35 |
|
| 36 |
--connection slave |
| 37 |
--source include/start_slave.inc |
| 38 |
|
| 39 |
# Wildcard for `state` as it depends on whether WSREP is compiled in or not. |
| 40 |
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(%' and command LIKE 'Slave_worker'; |
| 41 |
--source include/wait_condition.inc |
| 42 |
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit%' and command LIKE 'Slave_worker'; |
| 43 |
--source include/wait_condition.inc |
| 44 |
--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'; |
| 45 |
--source include/wait_condition.inc |
| 46 |
|
| 47 |
--let $t3_tid= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for prior transaction to start commit%'` |
| 48 |
--evalp kill $t3_tid |
| 49 |
|
| 50 |
--connection slave1 |
| 51 |
commit; |
| 52 |
|
| 53 |
--connection slave |
| 54 |
--let $slave_sql_errno=1032 |
| 55 |
--source include/wait_for_slave_sql_error.inc |
| 56 |
|
| 57 |
update t1 set a=1 where a=2; |
| 58 |
set @@global.slave_parallel_threads = @save.slave_parallel_threads; |
| 59 |
set @@global.slave_parallel_mode = @save.slave_parallel_mode; |
| 60 |
--source include/start_slave.inc |
| 61 |
|
| 62 |
--echo # |
| 63 |
--echo # Cleanup |
| 64 |
--connection master |
| 65 |
DROP TABLE t1, t2; |
| 66 |
--source include/save_master_gtid.inc |
| 67 |
|
| 68 |
--connection slave |
| 69 |
--source include/sync_with_master_gtid.inc |