List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:June 16 2011 12:36pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (frazer.clement:4459)
View as plain text  
#At file:///home/frazer/bzr/mysql-5.1-telco-7.0/ based on revid:ole.john.aske@stripped

 4459 Frazer Clement	2011-06-16
      Modify 2 channel circular replication testcase to use IGNORE_SERVER_IDS
      
      The 2 channel circular replication testcase uses the same server id for
      both MySQLDs on each site to avoid double application of 'reflected' events.
      
      This is not necessary with the IGNORE_SERVER_IDs CHANGE MASTER option, so
      the testcase is modified to use distinct server ids + IGNORE_SERVER_IDS.

    added:
      mysql-test/suite/ndb_rpl/ndb_master-slave_2ch_end.inc
    modified:
      mysql-test/suite/ndb_rpl/ndb_master-slave_2ch.inc
      mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch.result
      mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.cnf
      mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.test
=== modified file 'mysql-test/suite/ndb_rpl/ndb_master-slave_2ch.inc'
--- a/mysql-test/suite/ndb_rpl/ndb_master-slave_2ch.inc	2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/ndb_master-slave_2ch.inc	2011-06-16 12:36:28 +0000
@@ -3,10 +3,11 @@
 # Set up circular cluster replication where each 
 # cluster has two mysqlds and replication directions are 
 # following:
+#              1       2
 #          master ---> slave  
 #           /            \
 #     cluster A        cluster B
-#           \            /
+#           \  3       4 /
 #         master1 <--- slave1
 #
 # ==== Usage ====
@@ -26,8 +27,9 @@
 #   $rpl_skip_start_slave, $rpl_debug, $slave_timeout
 #     See include/master-slave.inc
 
+#--let $rpl_debug= 1
 --let $rpl_topology= 1->2,4->3
---let $rpl_skip_check_server_ids= 1
+--let $rpl_skip_start_slave= 1
 --source include/rpl_init.inc
 
 # Make connections to mysqlds
@@ -37,7 +39,7 @@
 --source include/rpl_connect.inc
 
 --let $rpl_connection_name= master1
---let $rpl_server_number= 1
+--let $rpl_server_number= 3
 --source include/rpl_connect.inc
 
 --let $rpl_connection_name= slave
@@ -45,9 +47,23 @@
 --source include/rpl_connect.inc
 
 --let $rpl_connection_name= slave1
---let $rpl_server_number= 2
+--let $rpl_server_number= 4
 --source include/rpl_connect.inc
 
+# Now add IGNORE_SERVER_IDS
+--disable_query_log
+connection master;
+CHANGE MASTER TO IGNORE_SERVER_IDS= (1,3);
+connection master1;
+CHANGE MASTER TO IGNORE_SERVER_IDS= (1,3);
+connection slave;
+CHANGE MASTER TO IGNORE_SERVER_IDS= (2,4);
+connection slave1;
+CHANGE MASTER TO IGNORE_SERVER_IDS= (2,4);
+
+# Now start replication
+--source include/rpl_start_slaves.inc
+--enable_query_log
 
 # Check that all mysqld are compiled with ndb support
 --let $_rpl_server= 4

=== added file 'mysql-test/suite/ndb_rpl/ndb_master-slave_2ch_end.inc'
--- a/mysql-test/suite/ndb_rpl/ndb_master-slave_2ch_end.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_rpl/ndb_master-slave_2ch_end.inc	2011-06-16 12:36:28 +0000
@@ -0,0 +1,28 @@
+# ==== Purpose ====
+#
+# Clean up replication configuration after using a 2ch
+# setup.
+# We need to explicitly reset the IGNORE_SERVER_IDS parameters
+# on all Servers to avoid testcase check errors.
+#
+# ==== Usage ====
+#
+#   [--let $rpl_debug= 1]
+#   --source suite/ndb_rpl/ndb_master-slave_2ch_end.inc
+#
+# Parameters:
+#   $rpl_debug
+#     See include/master-slave.inc
+
+--source include/rpl_stop_slaves.inc
+--connection master
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+--connection master1
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+--connection slave
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+--connection slave1
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+--source include/rpl_start_slaves.inc
+
+--source include/rpl_end.inc
\ No newline at end of file

=== modified file 'mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch.result'
--- a/mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch.result	2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch.result	2011-06-16 12:36:28 +0000
@@ -3,6 +3,7 @@ include/rpl_connect.inc [creating master
 include/rpl_connect.inc [creating master1]
 include/rpl_connect.inc [creating slave]
 include/rpl_connect.inc [creating slave1]
+include/rpl_start_slaves.inc
 
 *** Check server_id of mysqld servers ***
 SHOW VARIABLES LIKE "server_id";
@@ -12,7 +13,7 @@ SET auto_increment_offset = 1;
 SET auto_increment_increment = 2;
 SHOW VARIABLES LIKE "server_id";
 Variable_name	Value
-server_id	1
+server_id	3
 SET auto_increment_offset = 1;
 SET auto_increment_increment = 2;
 SHOW VARIABLES LIKE "server_id";
@@ -22,7 +23,7 @@ SET auto_increment_offset = 2;
 SET auto_increment_increment = 2;
 SHOW VARIABLES LIKE "server_id";
 Variable_name	Value
-server_id	2
+server_id	4
 SET auto_increment_offset = 2;
 SET auto_increment_increment = 2;
 
@@ -48,4 +49,10 @@ Check data on both clusters
 include/diff_tables.inc [master:t1, slave:t1]
 DROP TABLE IF EXISTS t1;
 
+include/rpl_stop_slaves.inc
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+include/rpl_start_slaves.inc
 include/rpl_end.inc

=== modified file 'mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.cnf'
--- a/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.cnf	2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.cnf	2011-06-16 12:36:28 +0000
@@ -2,34 +2,39 @@
 
 # 2 clusters, each with 2 MySQLDs
 # All MySQLDs log-slave-updates
-# Potential infinite loops are broken by both servers 
-# on each cluster having the same server-id
-# To support > 2 clusters and/or different server-ids per
-# MySQLD server, we need some other loop breaking 
-# mechanism 
+# All MySQLDs log-apply-status
+# Infinite loops broken in the test using Ignore_server_ids mechanism
 
 [mysqld.1.1]
 server-id= 1
 log-bin
+ndb_connectstring=	@mysql_cluster.1.ndb_connectstring
 log-slave-updates
+skip-slave-start
 
 [mysqld.2.1]
-server-id= 1
+server-id= 3
 log-bin
+ndb_connectstring=	@mysql_cluster.1.ndb_connectstring
 log-slave-updates
+skip-slave-start
 
 [mysqld.1.slave]
 server-id= 2
 log-bin
+ndb_connectstring=	@mysql_cluster.slave.ndb_connectstring
 log-slave-updates
 skip-slave-start
 
 [mysqld.2.slave]
-server-id= 2
+server-id= 4
 log-bin
 ndb_connectstring=	@mysql_cluster.slave.ndb_connectstring
+log-slave-updates
+skip-slave-start
 
 [ENV]
-
-SLAVE_MYPORT1=		@mysqld.2.slave.port
-SLAVE_MYSOCK1=		@mysqld.2.slave.socket
+SERVER_MYPORT_1=        @mysqld.1.1.port
+SERVER_MYPORT_2=        @mysqld.1.slave.port
+SERVER_MYPORT_3=        @mysqld.2.1.port
+SERVER_MYPORT_4=        @mysqld.2.slave.port

=== modified file 'mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.test'
--- a/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.test	2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.test	2011-06-16 12:36:28 +0000
@@ -163,5 +163,8 @@ DROP TABLE IF EXISTS t1;
 --source include/wait_for_query_to_fail.inc
 --echo
 
+--connection master
+
 # End of test 5.1
---source include/rpl_end.inc
+--source suite/ndb_rpl/ndb_master-slave_2ch_end.inc
+


Attachment: [text/bzr-bundle] bzr/frazer.clement@oracle.com-20110616123628-xf58sgunjc3i2i3m.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (frazer.clement:4459) Frazer Clement16 Jun