| 1 |
include/rpl_init.inc [topology=1->2] |
| 2 |
connection server_1; |
| 3 |
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; |
| 4 |
SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode; |
| 5 |
SET GLOBAL gtid_strict_mode= 1; |
| 6 |
connection server_2; |
| 7 |
include/stop_slave.inc |
| 8 |
SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode; |
| 9 |
SET GLOBAL gtid_strict_mode=1; |
| 10 |
CHANGE MASTER TO master_use_gtid=slave_pos; |
| 11 |
include/start_slave.inc |
| 12 |
connection server_1; |
| 13 |
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; |
| 14 |
INSERT INTO t1 VALUES (1); |
| 15 |
connection server_2; |
| 16 |
**** MDEV-4488: GTID position should be updated for events that are ignored due to server id *** |
| 17 |
include/stop_slave.inc |
| 18 |
CHANGE MASTER TO ignore_server_ids=(1); |
| 19 |
include/start_slave.inc |
| 20 |
connection server_1; |
| 21 |
INSERT INTO t1 VALUES (2); |
| 22 |
INSERT INTO t1 VALUES (3); |
| 23 |
connection server_2; |
| 24 |
RESULT |
| 25 |
OK |
| 26 |
SELECT * FROM t1 ORDER BY a; |
| 27 |
a |
| 28 |
1 |
| 29 |
include/stop_slave.inc |
| 30 |
CHANGE MASTER TO ignore_server_ids=(); |
| 31 |
include/start_slave.inc |
| 32 |
RESULT |
| 33 |
OK |
| 34 |
SELECT * FROM t1 ORDER BY a; |
| 35 |
a |
| 36 |
1 |
| 37 |
connection server_1; |
| 38 |
INSERT INTO t1 VALUES (4); |
| 39 |
INSERT INTO t1 VALUES (5); |
| 40 |
connection server_2; |
| 41 |
RESULT |
| 42 |
OK |
| 43 |
a |
| 44 |
1 |
| 45 |
4 |
| 46 |
5 |
| 47 |
*** Test the same thing when IO thread exits before SQL thread reaches end of log. *** |
| 48 |
connection server_2; |
| 49 |
include/stop_slave.inc |
| 50 |
SET @old_dbug= @@GLOBAL.debug_dbug; |
| 51 |
SET GLOBAL debug_dbug= "+d,inject_slave_sql_before_apply_event"; |
| 52 |
CHANGE MASTER TO ignore_server_ids=(1); |
| 53 |
include/start_slave.inc |
| 54 |
connection server_1; |
| 55 |
INSERT INTO t1 VALUES (6); |
| 56 |
INSERT INTO t1 VALUES (7); |
| 57 |
connection server_2; |
| 58 |
include/wait_for_slave_param.inc [Read_Master_Log_Pos] |
| 59 |
STOP SLAVE IO_THREAD; |
| 60 |
SET debug_sync = "now SIGNAL continue"; |
| 61 |
RESULT |
| 62 |
OK |
| 63 |
RESULT |
| 64 |
OK |
| 65 |
include/stop_slave.inc |
| 66 |
CHANGE MASTER TO ignore_server_ids=(); |
| 67 |
SET GLOBAL debug_dbug= @old_dbug; |
| 68 |
include/start_slave.inc |
| 69 |
connection server_1; |
| 70 |
INSERT INTO t1 VALUES (8); |
| 71 |
INSERT INTO t1 VALUES (9); |
| 72 |
connection server_2; |
| 73 |
SELECT * FROM t1 ORDER BY a; |
| 74 |
a |
| 75 |
1 |
| 76 |
4 |
| 77 |
5 |
| 78 |
8 |
| 79 |
9 |
| 80 |
connection server_1; |
| 81 |
DROP TABLE t1; |
| 82 |
ALTER TABLE mysql.gtid_slave_pos ENGINE=Aria; |
| 83 |
SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode; |
| 84 |
SET debug_sync = "reset"; |
| 85 |
connection server_2; |
| 86 |
SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode; |
| 87 |
SET debug_sync = "reset"; |
| 88 |
include/rpl_end.inc |