1include/master-slave.inc
2[connection master]
3connection server_2;
4include/stop_slave.inc
5SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
6SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
7SET @old_debug= @@GLOBAL.debug_dbug;
8SET GLOBAL slave_parallel_mode='optimistic';
9SET GLOBAL slave_parallel_threads= 3;
10CHANGE MASTER TO master_use_gtid=slave_pos;
11CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
12include/start_slave.inc
13connection server_1;
14ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
15CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB;
16include/save_master_gtid.inc
17connection server_2;
18include/sync_with_master_gtid.inc
19connect  con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
20BEGIN;
21INSERT INTO t1 VALUES (32);
22connection server_1;
23INSERT INTO t1 VALUES (32);
24connection server_2;
25SET GLOBAL debug_dbug="+d,hold_worker_on_schedule";
26SET debug_sync="debug_sync_action SIGNAL reached_pause WAIT_FOR continue_worker";
27connection server_1;
28SET gtid_seq_no=100;
29INSERT INTO t1 VALUES (33);
30connection server_2;
31SET debug_sync='now WAIT_FOR reached_pause';
32connection server_1;
33INSERT INTO t1 VALUES (34);
34connection server_2;
35connection con_temp2;
36COMMIT;
37connection server_2;
38include/stop_slave.inc
39include/assert.inc [table t1 should have zero rows where a>32]
40SELECT * FROM t1 WHERE a>32;
41a
42DELETE FROM t1 WHERE a=32;
43SET GLOBAL slave_parallel_threads=@old_parallel_threads;
44SET GLOBAL slave_parallel_mode=@old_parallel_mode;
45SET GLOBAL debug_dbug=@old_debug;
46SET DEBUG_SYNC= 'RESET';
47include/start_slave.inc
48connection server_1;
49DROP TABLE t1;
50include/rpl_end.inc
51