include/master-slave.inc [connection master] connection slave; call mtr.add_suppression("Both DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS lists can't be non-empty at the same time"); call mtr.add_suppression("DO_DOMAIN_IDS or IGNORE_DOMAIN_IDS lists can't be non-empty in non-GTID mode.*"); connection master; SET @@session.gtid_domain_id= 1; SELECT @@session.gtid_domain_id; @@session.gtid_domain_id 1 CREATE TABLE t1(i INT) ENGINE=INNODB; INSERT INTO t1 VALUES(1); SELECT * FROM t1; i 1 include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc SELECT * FROM t1; i 1 include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc DO_DOMAIN_IDS (AFTER) : 1 IGNORE_DOMAIN_IDS (AFTER) : connection master; SET @@session.gtid_domain_id= 2; INSERT INTO t1 VALUES(2); SET @@session.gtid_domain_id= 1; INSERT INTO t1 VALUES(3); SELECT * FROM t1; i 1 2 3 include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc SELECT * FROM t1; i 1 3 include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : 1 IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 connection master; SELECT @@session.gtid_domain_id; @@session.gtid_domain_id 1 INSERT INTO t1 VALUES(4); SET @@session.gtid_domain_id= 2; INSERT INTO t1 VALUES(5); SELECT * FROM t1; i 1 2 3 4 5 include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc SELECT * FROM t1; i 1 3 5 include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 include/stop_slave.inc Warnings: Note 1255 Slave already has been stopped DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO DO_DOMAIN_IDS=(4,4,5,1,7,7,7,1,1,2,6,8,1,4,5,5,9,3), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; include/start_slave.inc DO_DOMAIN_IDS (AFTER) : 1, 2, 3, 4, 5, 6, 7, 8, 9 IGNORE_DOMAIN_IDS (AFTER) : connection master; SELECT @@session.gtid_domain_id; @@session.gtid_domain_id 2 INSERT INTO t1 VALUES(8); SET @@session.gtid_domain_id= 7; INSERT INTO t1 VALUES(9); SET @@session.gtid_domain_id= 10; INSERT INTO t1 VALUES(10); INSERT INTO t1 VALUES(11); START TRANSACTION; INSERT INTO t1 VALUES(12); INSERT INTO t1 VALUES(13); COMMIT; INSERT INTO t1 VALUES(14); INSERT INTO t1 VALUES(15); include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc SELECT * FROM t1; i 1 3 5 8 9 connection slave; # Seconds_Behind_Master should be zero here because the slave is fully caught up and idle. Seconds_Behind_Master = '0' connection slave; include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : 1, 2, 3, 4, 5, 6, 7, 8, 9 IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 connection master; SET @@session.gtid_domain_id=2; CREATE TABLE t2(i int) ENGINE=MYISAM; CREATE TABLE t3(i int) ENGINE=INNODB; SET @@session.gtid_domain_id=1; BEGIN; INSERT INTO t2 VALUES(1); INSERT INTO t3 VALUES(1); connection slave; include/stop_slave.inc include/wait_for_slave_to_stop.inc connection master; INSERT INTO t2 VALUES(2); INSERT INTO t3 VALUES(2); COMMIT; include/save_master_gtid.inc connection slave; include/start_slave.inc include/sync_with_master_gtid.inc SELECT * FROM t2; i SELECT * FROM t3; i connection master; SET @@session.gtid_domain_id=1; BEGIN; INSERT INTO t2 VALUES(3); INSERT INTO t3 VALUES(3); include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; include/start_slave.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : connection master; INSERT INTO t2 VALUES(4); INSERT INTO t3 VALUES(4); COMMIT; include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc SELECT * FROM t2; i 4 SELECT * FROM t3; i 3 4 connection master; SET @@session.gtid_domain_id=1; BEGIN; INSERT INTO t2 VALUES(5); INSERT INTO t3 VALUES(5); include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos; include/start_slave.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 1 connection master; INSERT INTO t2 VALUES(6); INSERT INTO t3 VALUES(6); COMMIT; include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc SELECT * FROM t2; i 4 5 SELECT * FROM t3; i 3 4 connection slave; include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos; include/start_slave.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : 2 connection master; SET @@session.gtid_domain_id=2; BEGIN; INSERT INTO t2 VALUES(7); INSERT INTO t3 VALUES(7); COMMIT; include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 2 CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos; include/start_slave.inc DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : connection master; SET @@session.gtid_domain_id=2; BEGIN; INSERT INTO t2 VALUES(8); INSERT INTO t3 VALUES(8); COMMIT; include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc SELECT * FROM t2; i 4 5 8 SELECT * FROM t3; i 3 4 8 connection slave; include/stop_slave.inc DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS; CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS; CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log DO_DOMAIN_IDS (BEFORE) : IGNORE_DOMAIN_IDS (BEFORE) : 1 CHANGE MASTER TO MASTER_USE_GTID=NO; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO; CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=NO; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=NO; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log DO_DOMAIN_IDS (AFTER) : IGNORE_DOMAIN_IDS (AFTER) : CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), DO_DOMAIN_IDS=(), MASTER_USE_GTID=SLAVE_POS; include/start_slave.inc connection master; SET @@session.gtid_domain_id=2; DROP TABLE t1, t2, t3; include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc include/stop_slave.inc CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(); include/start_slave.inc include/rpl_end.inc