summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/rpl/include/mdev-31448_conservative.inc
blob: 3db5a000af097fdd6ed7890e1a0c441f4c8257ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--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

--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(-1)%' 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_timeout=1032
--source include/wait_for_slave_sql_to_stop.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