| 1 |
*** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang *** |
| 2 |
include/master-slave.inc |
| 3 |
[connection master] |
| 4 |
connection server_2; |
| 5 |
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; |
| 6 |
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode; |
| 7 |
include/stop_slave.inc |
| 8 |
SET GLOBAL slave_parallel_mode='conservative'; |
| 9 |
SET GLOBAL slave_parallel_threads=10; |
| 10 |
CHANGE MASTER TO master_use_gtid=slave_pos; |
| 11 |
include/start_slave.inc |
| 12 |
connection server_1; |
| 13 |
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; |
| 14 |
CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB; |
| 15 |
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; |
| 16 |
connection server_2; |
| 17 |
include/stop_slave.inc |
| 18 |
SET @old_dbug= @@GLOBAL.debug_dbug; |
| 19 |
SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep'; |
| 20 |
connection server_1; |
| 21 |
SET @old_dbug= @@SESSION.debug_dbug; |
| 22 |
SET SESSION debug_dbug="+d,binlog_force_commit_id"; |
| 23 |
SET @commit_id= 10000; |
| 24 |
ANALYZE TABLE t2; |
| 25 |
Table Op Msg_type Msg_text |
| 26 |
test.t2 analyze status Engine-independent statistics collected |
| 27 |
test.t2 analyze status OK |
| 28 |
INSERT INTO t3 VALUES (120, 0); |
| 29 |
SET @commit_id= 10001; |
| 30 |
INSERT INTO t3 VALUES (121, 0); |
| 31 |
SET SESSION debug_dbug=@old_dbug; |
| 32 |
SELECT * FROM t3 WHERE a >= 120 ORDER BY a; |
| 33 |
a b |
| 34 |
120 0 |
| 35 |
121 0 |
| 36 |
include/save_master_gtid.inc |
| 37 |
connection server_2; |
| 38 |
include/start_slave.inc |
| 39 |
include/sync_with_master_gtid.inc |
| 40 |
SELECT * FROM t3 WHERE a >= 120 ORDER BY a; |
| 41 |
a b |
| 42 |
120 0 |
| 43 |
121 0 |
| 44 |
include/stop_slave.inc |
| 45 |
SET GLOBAL debug_dbug= @old_dbug; |
| 46 |
SET GLOBAL slave_parallel_threads=@old_parallel_threads; |
| 47 |
SET GLOBAL slave_parallel_mode=@old_parallel_mode; |
| 48 |
include/start_slave.inc |
| 49 |
connection server_1; |
| 50 |
DROP TABLE t2,t3; |
| 51 |
include/rpl_end.inc |