| 1 |
include/rpl_init.inc [topology=1->2] |
| 2 |
call mtr.add_suppression("Slave: Commit failed due to failure of an earlier commit"); |
| 3 |
call mtr.add_suppression("Slave: Duplicate entry '99'"); |
| 4 |
connection server_1; |
| 5 |
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; |
| 6 |
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; |
| 7 |
INSERT INTO t1 VALUES(1,1); |
| 8 |
INSERT INTO t1 VALUES(2,1); |
| 9 |
INSERT INTO t1 VALUES(3,1); |
| 10 |
INSERT INTO t1 VALUES(4,1); |
| 11 |
connection server_2; |
| 12 |
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; |
| 13 |
include/stop_slave.inc |
| 14 |
SET @old_debug_dbug = @@global.debug_dbug; |
| 15 |
SET @@global.debug_dbug = "d,hold_worker2_favor_worker3"; |
| 16 |
SET GLOBAL slave_parallel_threads=4; |
| 17 |
CHANGE MASTER TO master_use_gtid=slave_pos; |
| 18 |
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode; |
| 19 |
SET GLOBAL slave_parallel_mode='optimistic'; |
| 20 |
connection server_1; |
| 21 |
SET @@gtid_seq_no = 2001; |
| 22 |
BEGIN; |
| 23 |
UPDATE t1 SET b = 11 WHERE a = 4; |
| 24 |
UPDATE t1 SET b = 11 WHERE a = 3; |
| 25 |
UPDATE t1 SET a = 99 WHERE a = 1; |
| 26 |
COMMIT; |
| 27 |
UPDATE t1 SET b = 2 WHERE a = 2; |
| 28 |
UPDATE t1 SET b = 3 WHERE a = 3; |
| 29 |
DROP TABLE IF EXISTS phantom_1; |
| 30 |
Warnings: |
| 31 |
Note 1051 Unknown table 'test.phantom_1' |
| 32 |
include/save_master_gtid.inc |
| 33 |
connect slave_local_0, 127.0.0.1, root,, test, $SLAVE_MYPORT,; |
| 34 |
begin; |
| 35 |
UPDATE t1 set b = 11 where a = 4; |
| 36 |
connect slave_local_1, 127.0.0.1, root,, test, $SLAVE_MYPORT,; |
| 37 |
begin; |
| 38 |
INSERT INTO t1 VALUES (99, 11); |
| 39 |
connect slave_local_2, 127.0.0.1, root,, test, $SLAVE_MYPORT,; |
| 40 |
begin; |
| 41 |
UPDATE t1 SET b = 12 WHERE a = 2; |
| 42 |
connect slave_local_3, 127.0.0.1, root,, test, $SLAVE_MYPORT,; |
| 43 |
begin; |
| 44 |
UPDATE t1 SET b = 13 WHERE a = 3; |
| 45 |
connection server_2; |
| 46 |
include/start_slave.inc |
| 47 |
# W4 is waiting to start its DROP |
| 48 |
connection slave_local_3; |
| 49 |
rollback; |
| 50 |
connection slave_local_0; |
| 51 |
rollback; |
| 52 |
SELECT count(*) = 0 as "W3 undid its commit state" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%"; |
| 53 |
W3 undid its commit state |
| 54 |
1 |
| 55 |
connection slave_local_2; |
| 56 |
rollback; |
| 57 |
connection slave_local_1; |
| 58 |
commit; |
| 59 |
SELECT COUNT(*) = 1 as "W4 remains with the same status" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit%"; |
| 60 |
W4 remains with the same status |
| 61 |
1 |
| 62 |
# Slave_SQL_Running YES = Yes |
| 63 |
# while W2 is held back ... |
| 64 |
SET DEBUG_SYNC = 'now SIGNAL cont_worker2'; |
| 65 |
include/wait_for_slave_sql_error.inc [errno=1062] |
| 66 |
DELETE FROM t1 WHERE a=99; |
| 67 |
include/start_slave.inc |
| 68 |
include/sync_with_master_gtid.inc |
| 69 |
connection server_2; |
| 70 |
include/stop_slave.inc |
| 71 |
SET GLOBAL slave_parallel_mode=@old_parallel_mode; |
| 72 |
SET GLOBAL slave_parallel_threads=@old_parallel_threads; |
| 73 |
SET @@global.debug_dbug = @old_debug_dbug; |
| 74 |
SET debug_sync = RESET; |
| 75 |
include/start_slave.inc |
| 76 |
connection server_1; |
| 77 |
DROP TABLE t1; |
| 78 |
include/save_master_gtid.inc |
| 79 |
connection server_2; |
| 80 |
include/sync_with_master_gtid.inc |
| 81 |
include/rpl_end.inc |