| 1 |
include/rpl_init.inc [topology=1->2] |
| 2 |
connection server_2; |
| 3 |
include/stop_slave.inc |
| 4 |
SET @slave_old_strict= @@GLOBAL.gtid_strict_mode; |
| 5 |
SET GLOBAL gtid_strict_mode= 1; |
| 6 |
CHANGE MASTER TO master_use_gtid=slave_pos; |
| 7 |
include/start_slave.inc |
| 8 |
connection server_1; |
| 9 |
SET @master_old_strict= @@GLOBAL.gtid_strict_mode; |
| 10 |
SET GLOBAL gtid_strict_mode= 1; |
| 11 |
CREATE TABLE t1 (a INT PRIMARY KEY); |
| 12 |
INSERT INTO t1 VALUES (1); |
| 13 |
connection server_2; |
| 14 |
SELECT * FROM t1 ORDER BY a; |
| 15 |
a |
| 16 |
1 |
| 17 |
include/stop_slave.inc |
| 18 |
connection server_1; |
| 19 |
INSERT INTO t1 VALUES (2); |
| 20 |
INSERT INTO t1 VALUES (3); |
| 21 |
RESET MASTER; |
| 22 |
SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; |
| 23 |
connection server_2; |
| 24 |
include/start_slave.inc |
| 25 |
connection server_1; |
| 26 |
INSERT INTO t1 VALUES (4); |
| 27 |
include/save_master_gtid.inc |
| 28 |
connection server_2; |
| 29 |
SET sql_log_bin= 0; |
| 30 |
CALL mtr.add_suppression("The binlog on the master is missing the GTID"); |
| 31 |
SET sql_log_bin= 1; |
| 32 |
include/wait_for_slave_io_error.inc [errno=1236] |
| 33 |
STOP SLAVE SQL_THREAD; |
| 34 |
SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; |
| 35 |
include/start_slave.inc |
| 36 |
include/sync_with_master_gtid.inc |
| 37 |
SELECT * FROM t1 ORDER BY a; |
| 38 |
a |
| 39 |
1 |
| 40 |
4 |
| 41 |
include/stop_slave.inc |
| 42 |
RESET SLAVE ALL; |
| 43 |
RESET MASTER; |
| 44 |
SET GLOBAL gtid_slave_pos= '0-2-10'; |
| 45 |
connection server_1; |
| 46 |
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2, |
| 47 |
master_user= 'root', master_ssl_verify_server_cert=0, master_use_gtid=CURRENT_POS; |
| 48 |
START SLAVE; |
| 49 |
connection server_2; |
| 50 |
INSERT INTO t1 VALUES (11); |
| 51 |
connection server_1; |
| 52 |
SET sql_log_bin= 0; |
| 53 |
CALL mtr.add_suppression("which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged"); |
| 54 |
SET sql_log_bin= 1; |
| 55 |
include/wait_for_slave_io_error.inc [errno=1236] |
| 56 |
connection server_1; |
| 57 |
STOP SLAVE SQL_THREAD; |
| 58 |
SET GLOBAL gtid_slave_pos= '0-2-10'; |
| 59 |
SET GLOBAL gtid_strict_mode= 0; |
| 60 |
include/start_slave.inc |
| 61 |
SELECT * FROM t1 ORDER BY a; |
| 62 |
a |
| 63 |
1 |
| 64 |
2 |
| 65 |
3 |
| 66 |
4 |
| 67 |
11 |
| 68 |
include/stop_slave.inc |
| 69 |
RESET SLAVE ALL; |
| 70 |
Warnings: |
| 71 |
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' |
| 72 |
INSERT INTO t1 VALUES (12); |
| 73 |
connection server_2; |
| 74 |
INSERT INTO t1 VALUES (22); |
| 75 |
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1, |
| 76 |
master_user= 'root', master_use_gtid=CURRENT_POS; |
| 77 |
START SLAVE; |
| 78 |
SET sql_log_bin= 0; |
| 79 |
CALL mtr.add_suppression("which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged"); |
| 80 |
SET sql_log_bin= 1; |
| 81 |
include/wait_for_slave_io_error.inc [errno=1236] |
| 82 |
STOP SLAVE SQL_THREAD; |
| 83 |
SET GLOBAL gtid_strict_mode= 0; |
| 84 |
CHANGE MASTER TO master_use_gtid=SLAVE_POS; |
| 85 |
SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; |
| 86 |
Warnings: |
| 87 |
Warning 1947 Specified GTID OLD_GTID_POS conflicts with the binary log which contains a more recent GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos |
| 88 |
include/start_slave.inc |
| 89 |
SELECT * FROM t1 ORDER BY a; |
| 90 |
a |
| 91 |
1 |
| 92 |
4 |
| 93 |
11 |
| 94 |
12 |
| 95 |
22 |
| 96 |
connection server_2; |
| 97 |
SET GLOBAL gtid_strict_mode= @slave_old_strict; |
| 98 |
connection server_1; |
| 99 |
DROP TABLE t1; |
| 100 |
SET GLOBAL gtid_strict_mode= @master_old_strict; |
| 101 |
include/rpl_end.inc |