1include/rpl_init.inc [topology=1->2] 2connection server_2; 3include/stop_slave.inc 4SET @slave_old_strict= @@GLOBAL.gtid_strict_mode; 5SET GLOBAL gtid_strict_mode= 1; 6CHANGE MASTER TO master_use_gtid=slave_pos; 7include/start_slave.inc 8connection server_1; 9SET @master_old_strict= @@GLOBAL.gtid_strict_mode; 10SET GLOBAL gtid_strict_mode= 1; 11CREATE TABLE t1 (a INT PRIMARY KEY); 12INSERT INTO t1 VALUES (1); 13connection server_2; 14SELECT * FROM t1 ORDER BY a; 15a 161 17include/stop_slave.inc 18connection server_1; 19INSERT INTO t1 VALUES (2); 20INSERT INTO t1 VALUES (3); 21RESET MASTER; 22SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; 23connection server_2; 24include/start_slave.inc 25connection server_1; 26INSERT INTO t1 VALUES (4); 27include/save_master_gtid.inc 28connection server_2; 29SET sql_log_bin= 0; 30CALL mtr.add_suppression("The binlog on the master is missing the GTID"); 31SET sql_log_bin= 1; 32include/wait_for_slave_io_error.inc [errno=1236] 33STOP SLAVE SQL_THREAD; 34SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; 35include/start_slave.inc 36include/sync_with_master_gtid.inc 37SELECT * FROM t1 ORDER BY a; 38a 391 404 41include/stop_slave.inc 42RESET SLAVE ALL; 43RESET MASTER; 44SET GLOBAL gtid_slave_pos= '0-2-10'; 45connection server_1; 46CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2, 47master_user= 'root', master_use_gtid=CURRENT_POS; 48START SLAVE; 49connection server_2; 50INSERT INTO t1 VALUES (11); 51connection server_1; 52SET sql_log_bin= 0; 53CALL 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"); 54SET sql_log_bin= 1; 55include/wait_for_slave_io_error.inc [errno=1236] 56connection server_1; 57STOP SLAVE SQL_THREAD; 58SET GLOBAL gtid_slave_pos= '0-2-10'; 59SET GLOBAL gtid_strict_mode= 0; 60include/start_slave.inc 61SELECT * FROM t1 ORDER BY a; 62a 631 642 653 664 6711 68include/stop_slave.inc 69RESET SLAVE ALL; 70INSERT INTO t1 VALUES (12); 71connection server_2; 72INSERT INTO t1 VALUES (22); 73CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1, 74master_user= 'root', master_use_gtid=CURRENT_POS; 75START SLAVE; 76SET sql_log_bin= 0; 77CALL 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"); 78SET sql_log_bin= 1; 79include/wait_for_slave_io_error.inc [errno=1236] 80STOP SLAVE SQL_THREAD; 81SET GLOBAL gtid_strict_mode= 0; 82CHANGE MASTER TO master_use_gtid=SLAVE_POS; 83SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; 84Warnings: 85Warning 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 86include/start_slave.inc 87SELECT * FROM t1 ORDER BY a; 88a 891 904 9111 9212 9322 94connection server_2; 95SET GLOBAL gtid_strict_mode= @slave_old_strict; 96connection server_1; 97DROP TABLE t1; 98SET GLOBAL gtid_strict_mode= @master_old_strict; 99include/rpl_end.inc 100