[Commits] Rev 3902: MDEV-6593: domain_id based replication filters in lp:~maria-captains/maria/10.0-galera-6593

Nirbhay Choubey nirbhay at mariadb.com
Fri Nov 7 04:49:47 EET 2014


At lp:~maria-captains/maria/10.0-galera-6593

------------------------------------------------------------
revno: 3902
revision-id: nirbhay at mariadb.com-20141107024939-jpfdcqfy7ht200hk
parent: nirbhay at mariadb.com-20141017220854-loksogxexms43ohc
committer: Nirbhay Choubey <nirbhay at mariadb.com>
branch nick: 10.0-galera-6593
timestamp: Thu 2014-11-06 21:49:39 -0500
message:
  MDEV-6593: domain_id based replication filters
  
  Addressed Kristian's review comment.
-------------- next part --------------
=== modified file 'mysql-test/suite/rpl/r/rpl_domain_id_filter.result'
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter.result	2014-10-10 23:06:40 +0000
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter.result	2014-11-07 02:49:39 +0000
@@ -1,5 +1,8 @@
 include/master-slave.inc
 [connection master]
+# On 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.*");
 # On master
 SET @@session.gtid_domain_id= 1;
 SELECT @@session.gtid_domain_id;
@@ -67,43 +70,22 @@
 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;
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 1
-IGNORE_DOMAIN_IDS (AFTER) : 2
-# On master
-SELECT @@session.gtid_domain_id;
-@@session.gtid_domain_id
-2
-INSERT INTO t1 VALUES(6);
-SET @@session.gtid_domain_id= 1;
-INSERT INTO t1 VALUES(7);
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-# On slave
-SELECT * FROM t1;
-i
-1
-3
-5
-7
+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
-DO_DOMAIN_IDS (BEFORE)     : 1
-IGNORE_DOMAIN_IDS (BEFORE) : 2
-CHANGE MASTER TO DO_DOMAIN_IDS=(4,4,5,1,7,7,7,1,1,2,6,8,1,4,5,5,9,3), MASTER_USE_GTID=slave_pos;
+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) : 2
+IGNORE_DOMAIN_IDS (AFTER) : 
 # On master
 SELECT @@session.gtid_domain_id;
 @@session.gtid_domain_id
-1
+2
 INSERT INTO t1 VALUES(8);
 SET @@session.gtid_domain_id= 7;
 INSERT INTO t1 VALUES(9);
@@ -122,7 +104,6 @@
 1
 3
 5
-7
 8
 9
 # On slave
@@ -131,15 +112,15 @@
 # On slave
 include/stop_slave.inc
 DO_DOMAIN_IDS (BEFORE)     : 1, 2, 3, 4, 5, 6, 7, 8, 9
-IGNORE_DOMAIN_IDS (BEFORE) : 2
+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
 # On master
 SET @@session.gtid_domain_id=2;
-CREATE TABLE t2(i int) ENGINE=INNODB;
-CREATE TABLE t3(i int) ENGINE=MYISAM;
+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);
@@ -177,11 +158,11 @@
 # On slave
 SELECT * FROM t2;
 i
+4
+SELECT * FROM t3;
+i
 3
 4
-SELECT * FROM t3;
-i
-4
 # On master
 SET @@session.gtid_domain_id=1;
 BEGIN;
@@ -202,12 +183,74 @@
 # On slave
 SELECT * FROM t2;
 i
-3
-4
-SELECT * FROM t3;
-i
-4
-5
+4
+5
+SELECT * FROM t3;
+i
+3
+4
+# On 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
+# On master
+SET @@session.gtid_domain_id=2;
+BEGIN;
+INSERT INTO t2 VALUES(7);
+INSERT INTO t3 VALUES(7);
+COMMIT;
+# On slave
+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) : 
+# On master
+SET @@session.gtid_domain_id=2;
+BEGIN;
+INSERT INTO t2 VALUES(8);
+INSERT INTO t3 VALUES(8);
+COMMIT;
+SELECT * FROM t2;
+i
+4
+5
+8
+SELECT * FROM t3;
+i
+3
+4
+8
+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
 # On master
 SET @@session.gtid_domain_id=2;
 DROP TABLE t1, t2, t3;

=== removed file 'mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash_no_gtid.result'
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash_no_gtid.result	2014-10-10 23:06:40 +0000
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash_no_gtid.result	1970-01-01 00:00:00 +0000
@@ -1,241 +0,0 @@
-include/master-slave.inc
-[connection master]
-# On 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
-# On slave
-call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
-SELECT * FROM t1;
-i
-1
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=no;
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 
-SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-# On master
-START TRANSACTION;
-INSERT INTO t1 VALUES(2);
-INSERT INTO t1 VALUES(3);
-COMMIT;
-SELECT * FROM t1;
-i
-1
-2
-3
-# On slave
-include/wait_for_slave_io_error.inc [errno=1595]
-SELECT * FROM t1;
-i
-1
-SET @@global.debug_dbug="-d";
-START SLAVE io_thread;
-include/wait_for_slave_io_to_start.inc
-SELECT * FROM t1;
-i
-1
-2
-3
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=no;
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 1
-SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-# On master
-START TRANSACTION;
-INSERT INTO t1 VALUES(4);
-INSERT INTO t1 VALUES(5);
-COMMIT;
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-# On slave
-include/wait_for_slave_io_error.inc [errno=1595]
-SELECT * FROM t1;
-i
-1
-2
-3
-SET @@global.debug_dbug="-d";
-START SLAVE io_thread;
-include/wait_for_slave_io_to_start.inc
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 1
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=no;
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 
-SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-# On master
-START TRANSACTION;
-INSERT INTO t1 VALUES(6);
-INSERT INTO t1 VALUES(7);
-COMMIT;
-START TRANSACTION;
-INSERT INTO t1 VALUES(8);
-INSERT INTO t1 VALUES(9);
-COMMIT;
-SET @@session.gtid_domain_id= 2;
-START TRANSACTION;
-INSERT INTO t1 VALUES(10);
-INSERT INTO t1 VALUES(11);
-COMMIT;
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-# On slave
-include/wait_for_slave_io_error.inc [errno=1595]
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-SET @@global.debug_dbug="-d";
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=no;
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 1
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 1
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=no;
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 1
-SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-# On master
-SET @@session.gtid_domain_id= 1;
-START TRANSACTION;
-INSERT INTO t1 VALUES(12);
-INSERT INTO t1 VALUES(13);
-COMMIT;
-START TRANSACTION;
-INSERT INTO t1 VALUES(14);
-INSERT INTO t1 VALUES(15);
-COMMIT;
-SET @@session.gtid_domain_id= 2;
-START TRANSACTION;
-INSERT INTO t1 VALUES(16);
-INSERT INTO t1 VALUES(17);
-COMMIT;
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-# On slave
-include/wait_for_slave_io_error.inc [errno=1595]
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-SET @@global.debug_dbug="-d";
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 1
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=no;
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-# On master
-DROP TABLE t1;
-# On slave
-include/stop_slave.inc
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
-include/start_slave.inc
-include/rpl_end.inc

=== removed file 'mysql-test/suite/rpl/r/rpl_domain_id_filter_no_gtid.result'
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_no_gtid.result	2014-10-17 22:08:54 +0000
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_no_gtid.result	1970-01-01 00:00:00 +0000
@@ -1,249 +0,0 @@
-include/master-slave.inc
-[connection master]
-# On 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
-# On slave
-SELECT * FROM t1;
-i
-1
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 
-CHANGE MASTER TO DO_DOMAIN_IDS=(1);
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 1
-IGNORE_DOMAIN_IDS (AFTER) : 
-# On 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
-# On slave
-SELECT * FROM t1;
-i
-1
-2
-3
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 1
-IGNORE_DOMAIN_IDS (BEFORE) : 
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1);
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 1
-# On 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
-# On slave
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-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);
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 1
-IGNORE_DOMAIN_IDS (AFTER) : 2
-# On master
-SELECT @@session.gtid_domain_id;
-@@session.gtid_domain_id
-2
-INSERT INTO t1 VALUES(6);
-SET @@session.gtid_domain_id= 1;
-INSERT INTO t1 VALUES(7);
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-# On slave
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 1
-IGNORE_DOMAIN_IDS (BEFORE) : 2
-CHANGE MASTER TO DO_DOMAIN_IDS=(4,4,5,1,7,7,7,1,1,2,6,8,1,4,5,5,9,3);
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 1, 2, 3, 4, 5, 6, 7, 8, 9
-IGNORE_DOMAIN_IDS (AFTER) : 2
-# On master
-SELECT @@session.gtid_domain_id;
-@@session.gtid_domain_id
-1
-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);
-# On slave
-SELECT * FROM t1;
-i
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-# On slave
-# Seconds_Behind_Master should be zero here because the slave is fully caught up and idle.
-Seconds_Behind_Master = '0'
-# On slave
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 1, 2, 3, 4, 5, 6, 7, 8, 9
-IGNORE_DOMAIN_IDS (BEFORE) : 2
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1);
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 1
-# On master
-SET @@session.gtid_domain_id=2;
-CREATE TABLE t2(i int) ENGINE=INNODB;
-CREATE TABLE t3(i int) ENGINE=MYISAM;
-SET @@session.gtid_domain_id=1;
-BEGIN;
-INSERT INTO t2 VALUES(1);
-INSERT INTO t3 VALUES(1);
-# On slave
-include/stop_slave.inc
-include/wait_for_slave_to_stop.inc
-# On master
-INSERT INTO t2 VALUES(2);
-INSERT INTO t3 VALUES(2);
-COMMIT;
-# On slave
-include/start_slave.inc
-SELECT * FROM t2;
-i
-1
-2
-SELECT * FROM t3;
-i
-1
-2
-# On master
-SET @@session.gtid_domain_id=1;
-BEGIN;
-INSERT INTO t2 VALUES(3);
-INSERT INTO t3 VALUES(3);
-# On slave
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 1
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 
-# On master
-INSERT INTO t2 VALUES(4);
-INSERT INTO t3 VALUES(4);
-COMMIT;
-# On slave
-SELECT * FROM t2;
-i
-1
-2
-3
-4
-SELECT * FROM t3;
-i
-1
-2
-3
-4
-# On master
-SET @@session.gtid_domain_id=1;
-BEGIN;
-INSERT INTO t2 VALUES(5);
-INSERT INTO t3 VALUES(5);
-# On slave
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1);
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 1
-# On master
-INSERT INTO t2 VALUES(6);
-INSERT INTO t3 VALUES(6);
-COMMIT;
-# On slave
-SELECT * FROM t2;
-i
-1
-2
-3
-4
-5
-6
-SELECT * FROM t3;
-i
-1
-2
-3
-4
-5
-6
-# On master
-DROP TABLE t1, t2, t3;
-# On slave
-include/stop_slave.inc
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
-include/start_slave.inc
-include/rpl_end.inc

=== removed file 'mysql-test/suite/rpl/r/rpl_domain_id_filter_old_master.result'
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_old_master.result	2014-10-10 23:06:40 +0000
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_old_master.result	1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
-include/master-slave.inc
-[connection master]
-include/stop_slave.inc
-include/rpl_stop_server.inc [server_number=1]
-include/rpl_start_server.inc [server_number=1]
-SET @old_parallel= @@GLOBAL.slave_parallel_threads;
-SET GLOBAL slave_parallel_threads=10;
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1,
-master_user='root', master_log_file='master-bin.000001',
-master_log_pos=4, IGNORE_DOMAIN_IDS=(0,1,2,3);
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 0, 1, 2, 3
-CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1);
-SELECT * FROM t1 ORDER BY a;
-a	b
-1	1
-2	2
-3	4
-4	8
-5	16
-SELECT * FROM t2;
-a
-1
-include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=@old_parallel;
-DROP TABLE t1;
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=();
-include/start_slave.inc
-DROP TABLE t2;
-include/rpl_end.inc

=== removed file 'mysql-test/suite/rpl/r/rpl_domain_id_filter_restart_no_gtid.result'
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart_no_gtid.result	2014-10-10 23:06:40 +0000
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart_no_gtid.result	1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
-include/master-slave.inc
-[connection master]
-# On slave
-include/stop_slave.inc
-DO_DOMAIN_IDS (BEFORE)     : 
-IGNORE_DOMAIN_IDS (BEFORE) : 
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1);
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 1
-# On master
-SET @@session.gtid_domain_id= 0;
-CREATE TABLE t1(i INT);
-CREATE TABLE t2(i INT);
-INSERT INTO t1 VALUES(1);
-SELECT * FROM t1;
-i
-1
-SET @@session.gtid_domain_id= 1;
-INSERT INTO t2 VALUES(1);
-SELECT * FROM t2;
-i
-1
-# On slave
-SELECT * FROM t1;
-i
-1
-SELECT * FROM t2;
-i
-1
-include/rpl_restart_server.inc [server_number=2]
-# On slave
-DO_DOMAIN_IDS (AFTER RESTART)     : 
-IGNORE_DOMAIN_IDS (AFTER RESTART) : 1
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=();
-include/start_slave.inc
-DO_DOMAIN_IDS (AFTER)     : 
-IGNORE_DOMAIN_IDS (AFTER) : 
-SELECT * FROM t1;
-i
-1
-SELECT * FROM t2;
-i
-1
-# On master
-SET @@session.gtid_domain_id= 0;
-DROP TABLE t1, t2;
-include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_domain_id_filter.test'
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter.test	2014-10-17 22:08:54 +0000
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter.test	2014-11-07 02:49:39 +0000
@@ -5,6 +5,11 @@
 # Test for DO_DOMAIN_IDS=(M1, M2, ..) and IGNORE_DOMAIN_IDS=(N1, N2, ..)
 #
 
+--echo # On slave
+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.*");
+
 --echo # On master
 connection master;
 SET @@session.gtid_domain_id= 1;
@@ -98,34 +103,14 @@
 --echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
 --echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
 
-# Replicate events belonging to "domain_id 1". (DO_DOMAIN_IDS should win!)
+--error ER_MASTER_INFO
 CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
---source include/start_slave.inc
-sync_with_master;
 
 let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
 let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
 --echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
 --echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
 
---echo # On master
-connection master;
-# @@session.gtid_domain_id = 2 (not in DO_DOMAIN_IDS)
-SELECT @@session.gtid_domain_id;
-# Should get filtered out on slave.
-INSERT INTO t1 VALUES(6);
-# Change it to 1 (in DO_DOMAIN_IDS).
-SET @@session.gtid_domain_id= 1;
-# Should get applied on slave.
-INSERT INTO t1 VALUES(7);
-
-SELECT * FROM t1;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-SELECT * FROM t1;
-
 ##### Case 4: Multiple domain ids.
 
 --source include/stop_slave.inc
@@ -134,8 +119,8 @@
 --echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
 --echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
 
-# Replicate events belonging to "domain_id 1". (DO_DOMAIN_IDS should win!)
-CHANGE MASTER TO DO_DOMAIN_IDS=(4,4,5,1,7,7,7,1,1,2,6,8,1,4,5,5,9,3), MASTER_USE_GTID=slave_pos;
+# Replicate events belonging to "domain_id 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;
 --source include/start_slave.inc
 sync_with_master;
 
@@ -178,7 +163,9 @@
 --let $status_items= Seconds_Behind_Master
 --source include/show_slave_status.inc
 
-##### Case 6: Stop slave in the middle of a transaction being filtered.
+##### Case 6: Stop slave before a transaction (involving MyISAM and InnoDB
+#             table) being filtered commits.
+
 --echo # On slave
 connection slave;
 --source include/stop_slave.inc
@@ -201,8 +188,8 @@
 connection master;
 # following statements should not get filtered.
 SET @@session.gtid_domain_id=2;
-CREATE TABLE t2(i int) ENGINE=INNODB;
-CREATE TABLE t3(i int) ENGINE=MYISAM;
+CREATE TABLE t2(i int) ENGINE=MYISAM;
+CREATE TABLE t3(i int) ENGINE=INNODB;
 
 SET @@session.gtid_domain_id=1;
 BEGIN;
@@ -233,8 +220,9 @@
 SELECT * FROM t2;
 SELECT * FROM t3;
 
-##### Case 7: Stop slave into the middle of a transaction being filtered and
-#             start it back with filtering disabled.
+##### Case 7: Stop slave before a transaction (involving MyISAM and InnoDB
+#             table) being filtered commits and start it back with filtering
+#             disabled.
 
 --echo # On master
 connection master;
@@ -315,6 +303,118 @@
 SELECT * FROM t2;
 SELECT * FROM t3;
 
+##### Case 9: Initially filter out events belonging to domain_id=2 and then
+#             remove the rule to check if event are not being filtered out.
+
+--echo # On slave
+connection slave;
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# IGNORE_DOMAIN_IDS(2)
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id=2;
+BEGIN;
+INSERT INTO t2 VALUES(7);
+INSERT INTO t3 VALUES(7);
+COMMIT;
+sync_slave_with_master;
+
+# Clear the filter
+--echo # On slave
+connection slave;
+--source include/stop_slave.inc
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# IGNORE_DOMAIN_IDS()
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
+--source include/start_slave.inc
+sync_with_master;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+--echo # On master
+connection master;
+SET @@session.gtid_domain_id=2;
+BEGIN;
+INSERT INTO t2 VALUES(8);
+INSERT INTO t3 VALUES(8);
+COMMIT;
+sync_slave_with_master;
+
+# On slave
+connection slave;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+##### Case 10: Test CHANGE MASTER with various "incompatible" combinations. 
+# On slave
+connection slave;
+--source include/stop_slave.inc
+
+# 10a: Both DO_DOMAIN_IDS & IGNORE_DOMAINIDS can't be non-empty at the same
+# time.
+
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+--error ER_MASTER_INFO
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+--error ER_MASTER_INFO
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+--error ER_MASTER_INFO
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=SLAVE_POS;
+
+# 10b: Neither DO_DOMAIN_IDS nor IGNORE_DOMAIN_IDS can be set when
+# MASTER_USE_GTID=NO
+
+let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
+--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
+
+# MASTER_USE_GTID can't be set to NO when either of IGNORE_DOMAIN_IDS or
+# DO_DOMAIN_IDS is non-empty.
+--error ER_MASTER_INFO
+CHANGE MASTER TO MASTER_USE_GTID=NO;
+CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO;
+--error ER_MASTER_INFO
+CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=NO;
+--error ER_MASTER_INFO
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=NO;
+
+let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
+let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
+--echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
+--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
+
+CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), DO_DOMAIN_IDS=(), MASTER_USE_GTID=SLAVE_POS;
+--source include/start_slave.inc
+sync_with_master;
+
 # Cleanup
 --echo # On master
 connection master;

=== removed file 'mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash_no_gtid.test'
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash_no_gtid.test	2014-10-10 23:06:40 +0000
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash_no_gtid.test	1970-01-01 00:00:00 +0000
@@ -1,252 +0,0 @@
---source include/have_debug.inc
---source include/have_innodb.inc
---source include/master-slave.inc
-
---echo # On master
-connection master;
-SET @@session.gtid_domain_id= 1;
-SELECT @@session.gtid_domain_id;
-CREATE TABLE t1(i INT) ENGINE=INNODB;
-INSERT INTO t1 VALUES(1);
-SELECT * FROM t1;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-
-call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
-
-##### Case 0 : IGNORE_DOMAIN_IDS=() before and after slave io thread crash.
-SELECT * FROM t1;
-
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=no;
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
-SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-
---echo # On master
-connection master;
-
-START TRANSACTION;
-INSERT INTO t1 VALUES(2);
-INSERT INTO t1 VALUES(3);
-COMMIT;
-save_master_pos;
-SELECT * FROM t1;
-
---echo # On slave
-connection slave;
---let $slave_io_errno= 1595
---source include/wait_for_slave_io_error.inc
-SELECT * FROM t1;
-SET @@global.debug_dbug="-d";
-
-START SLAVE io_thread;
---source include/wait_for_slave_io_to_start.inc
-sync_with_master;
-SELECT * FROM t1;
-
-##### Case 1 : IGNORE_DOMAIN_IDS=(1) before and after slave io thread crash.
-
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=no;
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
-SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-
---echo # On master
-connection master;
-
-START TRANSACTION;
-INSERT INTO t1 VALUES(4);
-INSERT INTO t1 VALUES(5);
-COMMIT;
-
-save_master_pos;
-SELECT * FROM t1;
-
---echo # On slave
-connection slave;
---let $slave_io_errno= 1595
---source include/wait_for_slave_io_error.inc
-SELECT * FROM t1;
-SET @@global.debug_dbug="-d";
-
-START SLAVE io_thread;
---source include/wait_for_slave_io_to_start.inc
-sync_with_master;
-SELECT * FROM t1;
-
-##### Case 2 : Initially IGNORE_DOMAIN_IDS=(), after io thread crash slave is
-# restarted with IGNORE_DOMAIN_IDS=(1).
-
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=no;
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
-SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-
---echo # On master
-connection master;
-
-START TRANSACTION;
-INSERT INTO t1 VALUES(6);
-INSERT INTO t1 VALUES(7);
-COMMIT; # IO thread should crash here.
-
-START TRANSACTION;
-INSERT INTO t1 VALUES(8);
-INSERT INTO t1 VALUES(9);
-COMMIT;
-
-SET @@session.gtid_domain_id= 2;
-
-START TRANSACTION;
-INSERT INTO t1 VALUES(10);
-INSERT INTO t1 VALUES(11);
-COMMIT;
-
-save_master_pos;
-SELECT * FROM t1;
-
---echo # On slave
-connection slave;
---let $slave_io_errno= 1595
---source include/wait_for_slave_io_error.inc
-SELECT * FROM t1;
-
-SET @@global.debug_dbug="-d";
-
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=no;
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
-SELECT * FROM t1;
-
-##### Case 3 : Initially IGNORE_DOMAIN_IDS=(1), after io thread crash slave is
-# restarted with IGNORE_DOMAIN_IDS=().
-
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=no;
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
-SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-
---echo # On master
-connection master;
-
-SET @@session.gtid_domain_id= 1;
-
-START TRANSACTION;
-INSERT INTO t1 VALUES(12);
-INSERT INTO t1 VALUES(13);
-COMMIT; # IO thread should crash here.
-
-START TRANSACTION;
-INSERT INTO t1 VALUES(14);
-INSERT INTO t1 VALUES(15);
-COMMIT;
-
-SET @@session.gtid_domain_id= 2;
-START TRANSACTION;
-INSERT INTO t1 VALUES(16);
-INSERT INTO t1 VALUES(17);
-COMMIT;
-
-save_master_pos;
-SELECT * FROM t1;
-
---echo # On slave
-connection slave;
---let $slave_io_errno= 1595
---source include/wait_for_slave_io_error.inc
-SELECT * FROM t1;
-
-SET @@global.debug_dbug="-d";
-
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=no;
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
-SELECT * FROM t1;
-
-# Cleanup
---echo # On master
-connection master;
-DROP TABLE t1;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
---source include/stop_slave.inc
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
---source include/start_slave.inc
-
---source include/rpl_end.inc

=== removed file 'mysql-test/suite/rpl/t/rpl_domain_id_filter_no_gtid.test'
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_no_gtid.test	2014-10-17 22:08:54 +0000
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_no_gtid.test	1970-01-01 00:00:00 +0000
@@ -1,324 +0,0 @@
---source include/have_innodb.inc
---source include/master-slave.inc
-
-#
-# Test for DO_DOMAIN_IDS=(M1, M2, ..) and IGNORE_DOMAIN_IDS=(N1, N2, ..) in
-# non-GTID mode.
-# Note: In non-GTID mode the DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS should
-# essentially remain ineffective.
-#
-
---echo # On master
-connection master;
-SET @@session.gtid_domain_id= 1;
-SELECT @@session.gtid_domain_id;
-CREATE TABLE t1(i INT) ENGINE=INNODB;
-INSERT INTO t1 VALUES(1);
-SELECT * FROM t1;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-
-##### Case 0 : When both DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS are empty.
-SELECT * FROM t1;
-
-##### Case 1: When DO_DOMAIN_IDS is non-empty.
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-# DO_DOMAIN_IDS=(1)
-CHANGE MASTER TO DO_DOMAIN_IDS=(1);
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---echo # On master
-connection master;
-# Lets change the session domain_id to 2 (not in DO_DOMAIN_IDS).
-SET @@session.gtid_domain_id= 2;
-INSERT INTO t1 VALUES(2);
-# Change it back to 1 (in DO_DOMAIN_IDS).
-SET @@session.gtid_domain_id= 1;
-INSERT INTO t1 VALUES(3);
-
-SELECT * FROM t1;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-SELECT * FROM t1;
-
-##### Case 2: When IGNORE_DOMAIN_IDS is non-empty.
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-# DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1)
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1);
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---echo # On master
-connection master;
-# @@session.gtid_domain_id = 1 (in IGNORE_DOMAIN_IDS)
-SELECT @@session.gtid_domain_id;
-INSERT INTO t1 VALUES(4);
-# Change it to 2 (not in IGNORE_DOMAIN_IDS).
-SET @@session.gtid_domain_id= 2;
-INSERT INTO t1 VALUES(5);
-
-SELECT * FROM t1;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-SELECT * FROM t1;
-
-##### Case 3: When both DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS are non-empty
-
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-# DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(2)
-CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(2);
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---echo # On master
-connection master;
-# @@session.gtid_domain_id = 2 (not in DO_DOMAIN_IDS)
-SELECT @@session.gtid_domain_id;
-INSERT INTO t1 VALUES(6);
-# Change it to 1 (in DO_DOMAIN_IDS).
-SET @@session.gtid_domain_id= 1;
-INSERT INTO t1 VALUES(7);
-
-SELECT * FROM t1;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-SELECT * FROM t1;
-
-##### Case 4: Multiple domain ids.
-
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-# DO_DOMAIN_IDS=(N1, N2, ...)
-CHANGE MASTER TO DO_DOMAIN_IDS=(4,4,5,1,7,7,7,1,1,2,6,8,1,4,5,5,9,3);
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---echo # On master
-connection master;
-# @@session.gtid_domain_id = 1 (in DO_DOMAIN_IDS)
-SELECT @@session.gtid_domain_id;
-INSERT INTO t1 VALUES(8);
-# Change it to 7 (in DO_DOMAIN_IDS).
-SET @@session.gtid_domain_id= 7;
-INSERT INTO t1 VALUES(9);
-# Change it to 10 (no in DO_DOMAIN_IDS).
-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);
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-SELECT * FROM t1;
-
-##### Case 5: Seconds_Behind_Master
---echo # On slave
-connection slave;
---echo # Seconds_Behind_Master should be zero here because the slave is fully caught up and idle.
---let $status_items= Seconds_Behind_Master
---source include/show_slave_status.inc
-
-##### Case 6: Stop slave in the middle of a transaction, the domain id of which
-##### is on the ignore list.
---echo # On slave
-connection slave;
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-# IGNORE_DOMAIN_IDS=(1)
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1);
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---echo # On master
-connection master;
-SET @@session.gtid_domain_id=2;
-CREATE TABLE t2(i int) ENGINE=INNODB;
-CREATE TABLE t3(i int) ENGINE=MYISAM;
-
-SET @@session.gtid_domain_id=1;
-BEGIN;
-INSERT INTO t2 VALUES(1);
-INSERT INTO t3 VALUES(1);
-sync_slave_with_master;
-
-# Now switch to slave to stop replication.
---echo # On slave
-connection slave;
---source include/stop_slave.inc
---source include/wait_for_slave_to_stop.inc
-
-# Back to master to finish the transaction.
---echo # On master
-connection master;
-INSERT INTO t2 VALUES(2);
-INSERT INTO t3 VALUES(2);
-COMMIT;
-save_master_pos;
-
-# On slave to start replication.
---echo # On slave
-connection slave;
---source include/start_slave.inc
-sync_with_master;
-
-SELECT * FROM t2;
-SELECT * FROM t3;
-
-##### Case 7: Stop slave into the middle of a transaction being filtered and
-#             start it back with filtering disabled.
-
---echo # On master
-connection master;
-SET @@session.gtid_domain_id=1;
-BEGIN;
-INSERT INTO t2 VALUES(3);
-INSERT INTO t3 VALUES(3);
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-# Clear IGNORE_DOMAIN_IDS
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---echo # On master
-connection master;
-INSERT INTO t2 VALUES(4);
-INSERT INTO t3 VALUES(4);
-COMMIT;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-SELECT * FROM t2;
-SELECT * FROM t3;
-
-##### Case 8: Stop slave into the middle of a transaction and start it back
-#             with filtering enabled.
-
---echo # On master
-connection master;
-SET @@session.gtid_domain_id=1;
-BEGIN;
-INSERT INTO t2 VALUES(5);
-INSERT INTO t3 VALUES(5);
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
---source include/stop_slave.inc
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-# IGNORE_DOMAIN_IDS(1)
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1);
---source include/start_slave.inc
-sync_with_master;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---echo # On master
-connection master;
-INSERT INTO t2 VALUES(6);
-INSERT INTO t3 VALUES(6);
-COMMIT;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-SELECT * FROM t2;
-SELECT * FROM t3;
-
-# Cleanup
---echo # On master
-connection master;
-DROP TABLE t1, t2, t3;
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
---source include/stop_slave.inc
-CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
---source include/start_slave.inc
-
---source include/rpl_end.inc

=== removed file 'mysql-test/suite/rpl/t/rpl_domain_id_filter_old_master.test'
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_old_master.test	2014-10-10 23:06:40 +0000
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_old_master.test	1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
-# Test replicating off old master with IGNORE_DOMAIN_IDS turned on.
-# We simulate old master by copying in pre-generated binlog files from earlier
-# server versions.
-
---source include/have_innodb.inc
---source include/master-slave.inc
-
---connection slave
---source include/stop_slave.inc
-
---connection master
---let $datadir= `SELECT @@datadir`
-
---let $rpl_server_number= 1
---source include/rpl_stop_server.inc
-
---remove_file $datadir/master-bin.000001
---copy_file $MYSQL_TEST_DIR/std_data/mariadb-5.5-binlog.000001 $datadir/master-bin.000001
-
---let $rpl_server_number= 1
---source include/rpl_start_server.inc
-
---source include/wait_until_connected_again.inc
-
---connection slave
-SET @old_parallel= @@GLOBAL.slave_parallel_threads;
-SET GLOBAL slave_parallel_threads=10;
-
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-
---replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
-eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1,
-     master_user='root', master_log_file='master-bin.000001',
-     master_log_pos=4, IGNORE_DOMAIN_IDS=(0,1,2,3);
-
---source include/start_slave.inc
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---connection master
-CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1);
---save_master_pos
-
---connection slave
---sync_with_master
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2;
-
---source include/stop_slave.inc
-SET GLOBAL slave_parallel_threads=@old_parallel;
-DROP TABLE t1;
-# Restore IGNORE_DOMAIN_IDS
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=();
---source include/start_slave.inc
-
---connection master
-DROP TABLE t2;
---source include/rpl_end.inc

=== removed file 'mysql-test/suite/rpl/t/rpl_domain_id_filter_restart_no_gtid.test'
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart_no_gtid.test	2014-10-10 23:06:40 +0000
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart_no_gtid.test	1970-01-01 00:00:00 +0000
@@ -1,79 +0,0 @@
---source include/master-slave.inc
-
-#
-# Test for domain-id based filter on slave restart in non-GTID-mode.
-#
-
-
---echo # On slave
-connection slave;
-
-source include/stop_slave.inc;
-let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
---echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before
-
-# Set IGNORE_DOMAIN_IDS=(1) without enabling GTID.
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1);
-source include/start_slave.inc;
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
---echo # On master
-connection master;
-SET @@session.gtid_domain_id= 0;
-CREATE TABLE t1(i INT);
-CREATE TABLE t2(i INT);
-
-INSERT INTO t1 VALUES(1);
-SELECT * FROM t1;
-
-SET @@session.gtid_domain_id= 1;
-# the following will not get filtered out.
-INSERT INTO t2 VALUES(1);
-SELECT * FROM t2;
-
-sync_slave_with_master;
-
---echo # On slave
-connection slave;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-# restart the slave
---let $rpl_server_number= 2
---source include/rpl_restart_server.inc
-
---echo # On slave
-# Replicate_Do_Domain_Ids/Replicate_Ignore_Domain_Ids should reinitialize
-# properly on restart.
-connection slave;
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER RESTART)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER RESTART) : $ignore_domain_ids_after
-
-# Now, lets clear IGNORE_DOMAIN_IDS.
-CHANGE MASTER TO IGNORE_DOMAIN_IDS=();
---source include/start_slave.inc
-
-let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
-let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
---echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
---echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
-
-SELECT * FROM t1;
-SELECT * FROM t2;
-
---echo # On master
-connection master;
-SET @@session.gtid_domain_id= 0;
-DROP TABLE t1, t2;
-sync_slave_with_master;
-
---source include/rpl_end.inc
-

=== modified file 'sql/rpl_mi.cc'
--- a/sql/rpl_mi.cc	2014-10-17 02:08:55 +0000
+++ b/sql/rpl_mi.cc	2014-11-07 02:49:39 +0000
@@ -1521,17 +1521,60 @@
 }
 
 /**
-  Update the domain id list of the given type with elements from the new list.
-
-  @param new_ids [IN]               new list of ids
-  @param type    [IN]               domain id list type to update
-
-  @retval                           void
+  Update the do/ignore domain id filter lists.
+
+  @param do_ids     [IN]            domain ids to be kept
+  @param ignore_ids [IN]            domain ids to be filtered out
+  @param using_gtid [IN]            use GTID?
+
+  @retval false                     Success
+          true                      Error
 */
-void Domain_id_filter::update_ids(DYNAMIC_ARRAY *new_ids, enum_list_type type)
+bool Domain_id_filter::update_ids(DYNAMIC_ARRAY *do_ids,
+                                  DYNAMIC_ARRAY *ignore_ids,
+                                  bool using_gtid)
 {
+  bool do_list_empty, ignore_list_empty;
+
+  if (do_ids)
+  {
+    do_list_empty= (do_ids->elements > 0) ? false : true;
+  } else {
+    do_list_empty= (m_domain_ids[DO_DOMAIN_IDS].elements > 0) ? false : true;
+  }
+
+  if (ignore_ids)
+  {
+    ignore_list_empty= (ignore_ids->elements > 0) ? false : true;
+  } else {
+    ignore_list_empty= (m_domain_ids[IGNORE_DOMAIN_IDS].elements > 0) ? false :
+      true;
+  }
+
+  if (!do_list_empty && !ignore_list_empty)
+  {
+    sql_print_error("Both DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS lists can't be "
+                    "non-empty at the same time");
+    return true;
+  }
+
+  if (using_gtid == Master_info::USE_GTID_NO &&
+      (!do_list_empty || !ignore_list_empty))
+  {
+    sql_print_error("DO_DOMAIN_IDS or IGNORE_DOMAIN_IDS lists can't be "
+                    "non-empty in non-GTID mode (MASTER_USE_GTID=no)");
+    return true;
+  }
+
+  if (do_ids)
+    update_change_master_ids(do_ids, &m_domain_ids[DO_DOMAIN_IDS]);
+
+  if (ignore_ids)
+    update_change_master_ids(ignore_ids, &m_domain_ids[IGNORE_DOMAIN_IDS]);
+
   m_filter= false;
-  update_change_master_ids(new_ids, &m_domain_ids[type]);
+
+  return false;
 }
 
 /**

=== modified file 'sql/rpl_mi.h'
--- a/sql/rpl_mi.h	2014-10-17 02:08:55 +0000
+++ b/sql/rpl_mi.h	2014-11-07 02:49:39 +0000
@@ -79,14 +79,17 @@
   void reset_filter();
 
   /*
-    Update the domain id list of the given type with elements from the new list.
-
-    @param new_ids [IN]               new list of ids
-    @param type    [IN]               domain id list type to update
-
-    @retval                           void
+    Update the do/ignore domain id filter lists.
+
+    @param do_ids     [IN]            domain ids to be kept
+    @param ignore_ids [IN]            domain ids to be filtered out
+    @param using_gtid [IN]            use GTID?
+
+    @retval false                     Success
+            true                      Error
   */
-  void update_ids(DYNAMIC_ARRAY *new_ids, enum_list_type type);
+  bool update_ids(DYNAMIC_ARRAY *do_ids, DYNAMIC_ARRAY *ignore_ids,
+                  bool using_gtid);
 
   /*
     Serialize and store the ids from domain id lists into the thd's protocol

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2014-10-10 23:06:40 +0000
+++ b/sql/slave.cc	2014-11-07 02:49:39 +0000
@@ -5681,47 +5681,28 @@
   }
   break;
 
-  case QUERY_EVENT:
-  {
-    bool is_commit_rollback=
-      Query_log_event::peek_is_commit_rollback(buf, event_len, checksum_alg);
+  default:
+  default_action:
 
-    DBUG_EXECUTE_IF("kill_slave_io_before_commit",
-                    {
-                      if(is_commit_rollback)
+    if (mi->using_gtid != Master_info::USE_GTID_NO &&
+        mi->events_queued_since_last_gtid > 0 &&
+        ((mi->last_queued_gtid_standalone &&
+          !Log_event::is_part_of_group((Log_event_type)(uchar)
+                                       buf[EVENT_TYPE_OFFSET])) ||
+         (!mi->last_queued_gtid_standalone &&
+          ((uchar)buf[EVENT_TYPE_OFFSET] == XID_EVENT ||
+           ((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT &&
+            Query_log_event::peek_is_commit_rollback(buf, event_len,
+                                                     checksum_alg))))))
+    {
+      DBUG_EXECUTE_IF("kill_slave_io_before_commit",
                       {
                         error= ER_SLAVE_RELAY_LOG_WRITE_FAILURE;
                         goto err;
-                      }
-                    };);
-
-    if ((mi->using_gtid != Master_info::USE_GTID_NO) &&
-        mi->domain_id_filter.is_group_filtered() &&
-        is_commit_rollback)
-    {
-      mi->domain_id_filter.reset_filter();
-    }
-    goto default_action;
-  }
-
-  case XID_EVENT:
-  {
-    DBUG_EXECUTE_IF("kill_slave_io_before_commit",
-                    {
-                      error= ER_SLAVE_RELAY_LOG_WRITE_FAILURE;
-                      goto err;
-                    };);
-
-    if ((mi->using_gtid != Master_info::USE_GTID_NO) &&
-        mi->domain_id_filter.is_group_filtered())
-    {
-      mi->domain_id_filter.reset_filter();
-    }
-    /* fallthrough */
-  }
-
-  default:
-  default_action:
+                      };);
+      mi->domain_id_filter.reset_filter();
+    }
+
     if (mi->using_gtid != Master_info::USE_GTID_NO && mi->gtid_event_seen)
     {
       if (unlikely(mi->gtid_reconnect_event_skip_count))
@@ -5831,11 +5812,8 @@
         (DO_DOMAIN_IDS/IGNORE_DOMAIN_IDS).
       */
       (mi->domain_id_filter.is_group_filtered() &&
-       buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT &&
-       buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT &&
-       buf[EVENT_TYPE_OFFSET] != GTID_LIST_EVENT &&
-       buf[EVENT_TYPE_OFFSET] != HEARTBEAT_LOG_EVENT &&
-       buf[EVENT_TYPE_OFFSET] != INCIDENT_EVENT))
+       Log_event::is_group_event((Log_event_type)(uchar)
+                                 buf[EVENT_TYPE_OFFSET])))
   {
     /*
       Do not write it to the relay log.

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2014-10-10 23:06:40 +0000
+++ b/sql/sql_repl.cc	2014-11-07 02:49:39 +0000
@@ -3242,6 +3242,8 @@
   char relay_log_info_file_tmp[FN_REFLEN];
   my_off_t saved_log_pos;
   LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
+  DYNAMIC_ARRAY *do_ids, *ignore_ids;
+
   DBUG_ENTER("change_master");
 
   mysql_mutex_assert_owner(&LOCK_active_mi);
@@ -3452,13 +3454,26 @@
            lex_mi->relay_log_name || lex_mi->relay_log_pos)
     mi->using_gtid= Master_info::USE_GTID_NO;
 
-  if (lex_mi->repl_do_domain_ids_opt == LEX_MASTER_INFO::LEX_MI_ENABLE)
-    mi->domain_id_filter.update_ids(&lex_mi->repl_do_domain_ids,
-                                    Domain_id_filter::DO_DOMAIN_IDS);
-
-  if (lex_mi->repl_ignore_domain_ids_opt == LEX_MASTER_INFO::LEX_MI_ENABLE)
-    mi->domain_id_filter.update_ids(&lex_mi->repl_ignore_domain_ids,
-                                    Domain_id_filter::IGNORE_DOMAIN_IDS);
+  do_ids= ((lex_mi->repl_do_domain_ids_opt ==
+            LEX_MASTER_INFO::LEX_MI_ENABLE) ?
+           &lex_mi->repl_do_domain_ids : NULL);
+
+  ignore_ids= ((lex_mi->repl_ignore_domain_ids_opt ==
+                LEX_MASTER_INFO::LEX_MI_ENABLE) ?
+               &lex_mi->repl_ignore_domain_ids : NULL);
+
+  /*
+    Note: mi->using_gtid stores the previous state in case no MASTER_USE_GTID
+    is specified.
+  */
+  if (mi->domain_id_filter.update_ids(do_ids, ignore_ids, mi->using_gtid))
+  {
+    my_error(ER_MASTER_INFO, MYF(0),
+             (int) lex_mi->connection_name.length,
+             lex_mi->connection_name.str);
+    ret= TRUE;
+    goto err;
+  }
 
   /*
     If user did specify neither host nor port nor any log name nor any log



More information about the commits mailing list