Debian Codegraph @

mysql-test/suite/rpl/r/rpl_parallel_single_grpcmt.result

raw
1 *** Test that group-committed transactions on the master can replicate in parallel on the slave. ***
2 include/master-slave.inc
3 [connection master]
4 connection server_1;
5 SET sql_log_bin=0;
6 CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
7 RETURNS INT DETERMINISTIC
8 BEGIN
9 RETURN x;
10 END
11 ||
12 SET sql_log_bin=1;
13 connection server_2;
14 include/stop_slave.inc
15 SET sql_log_bin=0;
16 CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
17 RETURNS INT DETERMINISTIC
18 BEGIN
19 IF d1 != '' THEN
20 SET debug_sync = d1;
21 END IF;
22 IF d2 != '' THEN
23 SET debug_sync = d2;
24 END IF;
25 RETURN x;
26 END
27 ||
28 SET sql_log_bin=1;
29 SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
30 SET GLOBAL slave_parallel_threads=10;
31 CHANGE MASTER TO master_use_gtid=slave_pos;
32 include/start_slave.inc
33 connection server_1;
34 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
35 CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
36 INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7);
37 connection server_2;
38 connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
39 BEGIN;
40 INSERT INTO t3 VALUES (2,102);
41 connect con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
42 BEGIN;
43 INSERT INTO t3 VALUES (4,104);
44 connect con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
45 SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
46 SET binlog_format=statement;
47 INSERT INTO t3 VALUES (2, foo(12,
48 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
49 ''));
50 connection server_1;
51 SET debug_sync='now WAIT_FOR master_queued1';
52 connect con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
53 SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
54 SET binlog_format=statement;
55 INSERT INTO t3 VALUES (4, foo(14,
56 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
57 ''));
58 connection server_1;
59 SET debug_sync='now WAIT_FOR master_queued2';
60 connect con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
61 SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
62 SET binlog_format=statement;
63 INSERT INTO t3 VALUES (6, foo(16,
64 'group_commit_waiting_for_prior SIGNAL slave_queued3',
65 ''));
66 connection server_1;
67 SET debug_sync='now WAIT_FOR master_queued3';
68 SET debug_sync='now SIGNAL master_cont1';
69 connection con_temp3;
70 connection con_temp4;
71 connection con_temp5;
72 SET debug_sync='RESET';
73 connection server_1;
74 SELECT * FROM t3 ORDER BY a;
75 a b
76 1 1
77 2 12
78 3 3
79 4 14
80 5 5
81 6 16
82 7 7
83 include/show_binlog_events.inc
84 Log_name Pos Event_type Server_id End_log_pos Info
85 master-bin.000001 # Gtid # # GTID #-#-#
86 master-bin.000001 # Query # # use `test`; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB
87 master-bin.000001 # Gtid # # GTID #-#-#
88 master-bin.000001 # Query # # use `test`; CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
89 master-bin.000001 # Gtid # # BEGIN GTID #-#-#
90 master-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7)
91 master-bin.000001 # Xid # # COMMIT /* XID */
92 master-bin.000001 # Gtid # # BEGIN GTID #-#-# cid=#
93 master-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (2, foo(12,
94 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
95 ''))
96 master-bin.000001 # Xid # # COMMIT /* XID */
97 master-bin.000001 # Gtid # # BEGIN GTID #-#-# cid=#
98 master-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (4, foo(14,
99 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
100 ''))
101 master-bin.000001 # Xid # # COMMIT /* XID */
102 master-bin.000001 # Gtid # # BEGIN GTID #-#-# cid=#
103 master-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (6, foo(16,
104 'group_commit_waiting_for_prior SIGNAL slave_queued3',
105 ''))
106 master-bin.000001 # Xid # # COMMIT /* XID */
107 connection server_2;
108 SET debug_sync='now WAIT_FOR slave_queued3';
109 connection con_temp1;
110 ROLLBACK;
111 connection server_2;
112 SET debug_sync='now WAIT_FOR slave_queued1';
113 connection con_temp2;
114 ROLLBACK;
115 connection server_2;
116 SET debug_sync='now WAIT_FOR slave_queued2';
117 SET debug_sync='now SIGNAL slave_cont1';
118 SELECT * FROM t3 ORDER BY a;
119 a b
120 1 1
121 2 12
122 3 3
123 4 14
124 5 5
125 6 16
126 7 7
127 include/show_binlog_events.inc
128 Log_name Pos Event_type Server_id End_log_pos Info
129 slave-bin.000001 # Gtid # # GTID #-#-#
130 slave-bin.000001 # Query # # use `test`; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB
131 slave-bin.000001 # Gtid # # GTID #-#-#
132 slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
133 slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
134 slave-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7)
135 slave-bin.000001 # Xid # # COMMIT /* XID */
136 slave-bin.000001 # Gtid # # BEGIN GTID #-#-# cid=#
137 slave-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (2, foo(12,
138 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
139 ''))
140 slave-bin.000001 # Xid # # COMMIT /* XID */
141 slave-bin.000001 # Gtid # # BEGIN GTID #-#-# cid=#
142 slave-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (4, foo(14,
143 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
144 ''))
145 slave-bin.000001 # Xid # # COMMIT /* XID */
146 slave-bin.000001 # Gtid # # BEGIN GTID #-#-# cid=#
147 slave-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (6, foo(16,
148 'group_commit_waiting_for_prior SIGNAL slave_queued3',
149 ''))
150 slave-bin.000001 # Xid # # COMMIT /* XID */
151 connection server_2;
152 include/stop_slave.inc
153 SET GLOBAL slave_parallel_threads=@old_parallel_threads;
154 include/start_slave.inc
155 SET DEBUG_SYNC= 'RESET';
156 connection server_1;
157 DROP function foo;
158 DROP TABLE t3;
159 SET DEBUG_SYNC= 'RESET';
160 include/rpl_end.inc