MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:January 12 2010 3:49pm
Subject:bzr commit into mysql-backup-backport branch (aelkin:3050) Bug#50176
View as plain text  
#At file:///home/andrei/MySQL/BZR/FIXES/bckp_port-bug_rpl_backup/ based on revid:thavamuni.alagu@stripped

 3050 Andrei Elkin	2010-01-12
      Bug #50176 rpl_backup_block times out on mysql-backup-backport
      
      The timeout happened as a combination of actual values for the global master_retry_connect
      and mi->connect_retry set way too big and treating ER_MASTER_BLOCKING_SLAVES as a reconnectable
      error.
      
      Fixed with setting the two parameters of the 2nd slave to correspond to mtr defaults
      and making `ER_MASTER_BLOCKING_SLAVES' critical so that auto-reconnecting is not to happen.
     @ mysql-test/suite/rpl/r/rpl_backup_block.result
        results changed.
     @ mysql-test/suite/rpl/t/rpl_backup_block.cnf
        Setting the slave connect retry to the mtr's default.
     @ mysql-test/suite/rpl/t/rpl_backup_block.test
        setting up MASTER_CONNECT_RETRY=1 for the 2nd slave explicitly to the value of 
        master-slave-reset.inc;
        simplifying output in the case 2;
        correcting the suppressions.
     @ sql/share/errmsg-utf8.txt
        editing ER_MASTER_BLOCKING_SLAVES error message.
     @ sql/share/errmsg.txt
        editing ER_MASTER_BLOCKING_SLAVES error message.
     @ sql/slave.cc
        Making `ER_MASTER_BLOCKING_SLAVES' critical so that auto-reconnecting is not to happen.

    modified:
      mysql-test/suite/rpl/r/rpl_backup_block.result
      mysql-test/suite/rpl/t/rpl_backup_block.cnf
      mysql-test/suite/rpl/t/rpl_backup_block.test
      sql/share/errmsg-utf8.txt
      sql/share/errmsg.txt
      sql/slave.cc
=== modified file 'mysql-test/suite/rpl/r/rpl_backup_block.result'
--- a/mysql-test/suite/rpl/r/rpl_backup_block.result	2010-01-06 15:03:50 +0000
+++ b/mysql-test/suite/rpl/r/rpl_backup_block.result	2010-01-12 15:49:15 +0000
@@ -114,55 +114,16 @@ The incident RESTORE_ON_MASTER occured o
 # Case 2 - Verify a new slave cannot connect
 #
 # Connecting to slave 2...
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_A_PORT,master_user='root',MASTER_LOG_FILE='MASTER_A_LOG_FILE';
+CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_A_PORT, master_user='root', MASTER_CONNECT_RETRY=1, MASTER_LOG_FILE='MASTER_A_LOG_FILE';
 # Capture slave 2's backupdir.
 SET @@global.backupdir= @@global.datadir;
 # Now verify slave cannot start.
 START SLAVE IO_THREAD;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	60
-Master_Log_File	#
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	#
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	#
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	1765
-Last_IO_Error	The master is not allowing slave connections.
-Last_SQL_Errno	#
-Last_SQL_Error	#
-Replicate_Ignore_Server_Ids	
-Master_Server_Id	1
 # Show the slave stopped with an error.
+Slave_IO_Running
+No
 Last_IO_Error
-The master is not allowing slave connections.
+The master does not allow slave connections.
 #
 # Case 3 - Verify connected slave cannot reestablish replication
 #
@@ -264,7 +225,7 @@ Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
 Master_Port	MASTER_PORT
-Connect_Retry	60
+Connect_Retry	1
 Master_Log_File	#
 Read_Master_Log_Pos	#
 Relay_Log_File	#
@@ -340,6 +301,6 @@ DROP DATABASE rpl_backup_block;
 SET @@global.backupdir = DEFAULT;
 SET DEBUG_SYNC = 'reset';
 call mtr.add_suppression("Stopping slave I.O thread due to Restore are running on the master");
-call mtr.add_suppression("Slave I.O: The master is not allowing slave connections. Error_code: 1765");
+call mtr.add_suppression(".*master does not allow slave connections");
 call mtr.add_suppression("Stopping slave I.O thread due to Restore are running on the master");
-call mtr.add_suppression("Slave I.O: The master is not allowing slave connections. Error_code: 1765");
+call mtr.add_suppression(".*master does not allow slave connections");

=== modified file 'mysql-test/suite/rpl/t/rpl_backup_block.cnf'
--- a/mysql-test/suite/rpl/t/rpl_backup_block.cnf	2010-01-06 15:18:07 +0000
+++ b/mysql-test/suite/rpl/t/rpl_backup_block.cnf	2010-01-12 15:49:15 +0000
@@ -8,9 +8,8 @@ server_id=2
 
 [mysqld.3]
 server_id=3
+master-retry-count=10
 
 [ENV]
 SLAVE_MYPORT2=		@mysqld.3.port
 SLAVE_MYSOCK2=		@mysqld.3.socket
-
-

=== modified file 'mysql-test/suite/rpl/t/rpl_backup_block.test'
--- a/mysql-test/suite/rpl/t/rpl_backup_block.test	2010-01-06 15:03:50 +0000
+++ b/mysql-test/suite/rpl/t/rpl_backup_block.test	2010-01-12 15:49:15 +0000
@@ -107,10 +107,16 @@ eval SELECT "$last_error" AS Last_SQL_Er
 --echo # Case 2 - Verify a new slave cannot connect
 --echo #
 
+#
+# The 2nd slave reconnecting parameters should as small as to force
+# IO to stop before wait_for_slave_io_to_stop's timer has elapsed.
+# Notice, MASTER_CONNECT_RETRY=1 and master-retry-count=10 of the test cnf file.
+#
 --echo # Connecting to slave 2...
+
 connection slave2;
 --replace_result $MASTER_MYPORT MASTER_A_PORT $_binlog_file MASTER_A_LOG_FILE
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root',MASTER_LOG_FILE='$_binlog_file'
+--eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$MASTER_MYPORT, master_user='root', MASTER_CONNECT_RETRY=1, MASTER_LOG_FILE='$_binlog_file'
 
 --echo # Capture slave 2's backupdir.
 let $MYSQLD_S2_BACKUPDIR= `select @@datadir`;
@@ -120,13 +126,11 @@ SET @@global.backupdir= @@global.datadir
 START SLAVE IO_THREAD;
 source include/wait_for_slave_io_to_stop.inc;
 
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 16 # 21 # 22 # 23 # 33 # 37 # 38 #
---query_vertical SHOW SLAVE STATUS
-
 --echo # Show the slave stopped with an error.
+LET $io_status= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
 LET $last_error= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1);
 --disable_query_log
+eval SELECT "$io_status" AS Slave_IO_Running;
 eval SELECT "$last_error" AS Last_IO_Error;
 --enable_query_log
 
@@ -279,7 +283,7 @@ SET DEBUG_SYNC = 'reset';
 
 connection slave;
 call mtr.add_suppression("Stopping slave I.O thread due to Restore are running on the master");
-call mtr.add_suppression("Slave I.O: The master is not allowing slave connections. Error_code: 1765");
+call mtr.add_suppression(".*master does not allow slave connections");
 connection slave2;
 call mtr.add_suppression("Stopping slave I.O thread due to Restore are running on the master");
-call mtr.add_suppression("Slave I.O: The master is not allowing slave connections. Error_code: 1765");
+call mtr.add_suppression(".*master does not allow slave connections");

=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt	2010-01-06 14:34:59 +0000
+++ b/sql/share/errmsg-utf8.txt	2010-01-12 15:49:15 +0000
@@ -6512,7 +6512,7 @@ ER_BACKUP_LOGS_DELETED
 ER_BACKUP_LOGS_TRUNCATED
   eng "All backup log entries have been deleted"
 ER_MASTER_BLOCKING_SLAVES
-  eng "The master is not allowing slave connections."
+  eng "The master does not allow slave connections."
 ER_RESTORE_ON_MASTER
   eng "A restore operation was initiated on the master."
 ER_RESTORE_ON_SLAVE

=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2010-01-06 14:34:59 +0000
+++ b/sql/share/errmsg.txt	2010-01-12 15:49:15 +0000
@@ -6514,7 +6514,7 @@ ER_BACKUP_LOGS_DELETED
 ER_BACKUP_LOGS_TRUNCATED
   eng "All backup log entries have been deleted"
 ER_MASTER_BLOCKING_SLAVES
-  eng "The master is not allowing slave connections."
+  eng "The master does not allow slave connections."
 ER_RESTORE_ON_MASTER
   eng "A restore operation was initiated on the master."
 ER_RESTORE_ON_SLAVE

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-12-22 16:09:15 +0000
+++ b/sql/slave.cc	2010-01-12 15:49:15 +0000
@@ -2803,6 +2803,12 @@ Stopping slave I/O thread due to out-of-
           mi->report(ERROR_LEVEL, ER_OUT_OF_RESOURCES,
                      "%s", ER(ER_OUT_OF_RESOURCES));
           goto err;
+        case ER_MASTER_BLOCKING_SLAVES:
+          sql_print_error("\
+Stopping slave I/O thread due to master does not allow slave connections");
+          mi->report(ERROR_LEVEL, ER_MASTER_BLOCKING_SLAVES,
+                     "%s", ER(ER_MASTER_BLOCKING_SLAVES));
+          goto err;
         }
         if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
                              reconnect_messages[SLAVE_RECON_ACT_EVENT]))


Attachment: [text/bzr-bundle] bzr/aelkin@mysql.com-20100112154915-fg3f1we00tc7dwrq.bundle
Thread
bzr commit into mysql-backup-backport branch (aelkin:3050) Bug#50176Andrei Elkin12 Jan