List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:May 12 2009 5:58pm
Subject:bzr commit into mysql-6.0-backup branch (charles.bell:2809) Bug#44830
View as plain text  
#At file:///C:/source/bzr/mysql-6.0-pb-fix/ based on revid:hema@stripped

 2809 Chuck Bell	2009-05-12
      BUG#44830 : SLAVE START no longer results in error if RESTORE is running on master
      
      Disabled portions of rpl_backup test because the slave no longer
      returns an error when a restore is in progress. This is a change
      in the way the slaves connect to the master and must be fixed.
      It has broken the ability to block slave connections (via START
      SLAVE) while a restore is in progress.
      
      Previously, when a slave attempted to connect to a master that
      had a restore in progress, the START SLAVE command would fail and
      an error would be sent to the client. Now, the command succeeds and
      no error is sent to the client. Since this test relies on detecting
      the error, it fails when run against the latest code.
      
      It is likely the mechanism for how the slave connects and/or the 
      sequence of events for detecting errors has changed thereby 
      causing the slave to delay the detection of being blocked by a
      restore run on the master.
      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

per-file messages:
  mysql-test/suite/rpl/r/rpl_backup_block.result
    New result file.
  mysql-test/suite/rpl/t/rpl_backup_block.cnf
    Minor correction to config file for proper bug diagnostics.
  mysql-test/suite/rpl/t/rpl_backup_block.test
    Portions disabled until bug is fixed.
=== modified file 'mysql-test/suite/rpl/r/rpl_backup_block.result'
--- a/mysql-test/suite/rpl/r/rpl_backup_block.result	2009-05-06 19:14:50 +0000
+++ b/mysql-test/suite/rpl/r/rpl_backup_block.result	2009-05-12 17:58:19 +0000
@@ -111,24 +111,6 @@ Master_Server_Id	1
 Last_SQL_Error
 The incident RESTORE_ON_MASTER occured on the master. Message: A restore operation was initiated on the master.
 #
-# 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';
-# Capture slave 2's backupdir.
-SET @@global.backupdir = @@global.datadir;
-# Now verify slave cannot start.
-START SLAVE;
-ERROR HY000: Cannot start slave. SLAVE START is blocked by RESTORE.
-#
-# Case 3 - Verify connected slave cannot reestablish replication
-#
-# Connecting to slave 1...
-START SLAVE SQL_THREAD;
-# Show the slave stopped with an error.
-Last_SQL_Error
-The incident RESTORE_ON_MASTER occured on the master. Message: A restore operation was initiated on the master.
-#
 # Now resume restore on master
 #
 SET DEBUG_SYNC = 'now SIGNAL finish';
@@ -150,6 +132,7 @@ a
 3
 4
 5
+# Get master's binlog position before restore.
 #
 # Case 4 - Verify slaves can connect after restore
 #
@@ -213,79 +196,12 @@ a
 4
 5
 90125
-# Connecting to slave 2...
-STOP SLAVE;
-SET global sql_slave_skip_counter=1;
-START SLAVE;
-# Showing tables on slave.
-SHOW FULL TABLES FROM rpl_backup_block;
-Tables_in_rpl_backup_block	Table_type
-t1	BASE TABLE
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	#
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	#
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-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	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-Replicate_Ignore_Server_Ids	
-Master_Server_Id	1
-# Show the slave started without an error.
-Last_SQL_Error
-
-SELECT * FROM rpl_backup_block.t1;
-a
-1
-2
-3
-4
-5
-90125
 #
 # Cleanup
 #
 # Connecting to slave 1...
 # Now stop the slave.
 SLAVE STOP;
-# Connecting to slave 2...
-# Now stop the slave.
-SLAVE STOP;
-Warnings:
-Note	1255	Slave already has been stopped
-# Reset slave 2's backupdir.
-SET @@global.backupdir = DEFAULT;
 # Connecting to master...
 DROP DATABASE rpl_backup_block;
 # Reset master's backupdir.

=== modified file 'mysql-test/suite/rpl/t/rpl_backup_block.cnf'
--- a/mysql-test/suite/rpl/t/rpl_backup_block.cnf	2009-04-29 17:49:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_backup_block.cnf	2009-05-12 17:58:19 +0000
@@ -10,8 +10,7 @@ server_id=2
 server_id=3
 
 [ENV]
-SLAVE_MYPORT1=		@mysqld.3.port
-SLAVE_MYSOCK1=		@mysqld.3.socket
-
+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	2009-05-06 19:14:50 +0000
+++ b/mysql-test/suite/rpl/t/rpl_backup_block.test	2009-05-12 17:58:19 +0000
@@ -101,42 +101,45 @@ LET $last_error = query_get_value("SHOW 
 eval SELECT "$last_error" AS Last_SQL_Error;
 --enable_query_log
 
---echo #
---echo # Case 2 - Verify a new slave cannot connect
---echo #
-
-connect (slave2,localhost,root,,test,$SLAVE_MYPORT2,);
-
---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'
-
---echo # Capture slave 2's backupdir.
-let $MYSQLD_S2_BACKUPDIR= `select @@datadir`;
-SET @@global.backupdir = @@global.datadir;
-
---echo # Now verify slave cannot start.
---error ER_RESTORE_CANNOT_START_SLAVE
-START SLAVE;
-
---echo #
---echo # Case 3 - Verify connected slave cannot reestablish replication
---echo #
-
---echo # Connecting to slave 1...
-connection slave;
-
-START SLAVE SQL_THREAD;
-source include/wait_for_slave_sql_to_stop.inc;
-
---echo # Show the slave stopped with an error.
-LET $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
---disable_query_log
-eval SELECT "$last_error" AS Last_SQL_Error;
---enable_query_log
-
+#
+# BUG#44830 : SLAVE START no longer results in error if RESTORE is running on master
+#
+#--echo #
+#--echo # Case 2 - Verify a new slave cannot connect
+#--echo #
+#
+#connect (slave2,localhost,root,,test,$SLAVE_MYPORT2,$SLAVE_MYSOCK2);
+#
+#--echo # Connecting to slave 2...
+#connection slave2;
+#
+#--echo # Capture slave 2's backupdir.
+#let $MYSQLD_S2_BACKUPDIR= `select @@datadir`;
+#SET @@global.backupdir = @@global.datadir;
+#
+#--replace_result $MASTER_MYPORT MASTER_A_PORT $_binlog_file MASTER_A_LOG_FILE $master_before_pos MASTER_A_LOG_POS
+#--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root',master_log_file='$_binlog_file',master_log_pos=$master_before_pos
+#
+#--echo # Now verify slave cannot start.
+#--error ER_RESTORE_CANNOT_START_SLAVE
+#START SLAVE;
+#
+#--echo #
+#--echo # Case 3 - Verify connected slave cannot reestablish replication
+#--echo #
+#
+#--echo # Connecting to slave 1...
+#connection slave;
+#
+#START SLAVE SQL_THREAD;
+#source include/wait_for_slave_sql_to_start.inc;
+#
+#--echo # Show the slave stopped with an error.
+#LET $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+#--disable_query_log
+#eval SELECT "$last_error" AS Last_SQL_Error;
+#--enable_query_log
+#
 --echo #
 --echo # Now resume restore on master
 --echo #
@@ -162,6 +165,9 @@ SHOW FULL TABLES FROM rpl_backup_block;
 
 SELECT * FROM rpl_backup_block.t1;
 
+--echo # Get master's binlog position before restore.
+let $master_after_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
+
 --echo #
 --echo # Case 4 - Verify slaves can connect after restore
 --echo #
@@ -195,33 +201,32 @@ eval SELECT "$last_error" AS Last_SQL_Er
 
 SELECT * FROM rpl_backup_block.t1;
 
---echo # Connecting to slave 2...
-
-STOP SLAVE;
---source include/wait_for_slave_to_stop.inc
-
-SET global sql_slave_skip_counter=1;
-
-START SLAVE;
---source include/wait_for_slave_to_start.inc
-
-# Sync with master to ensure nothing is replicated after incident event.
-sync_with_master;
-
---echo # Showing tables on slave.
-SHOW FULL TABLES FROM rpl_backup_block;
-
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 16 # 21 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-
---echo # Show the slave started without an error.
-LET $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
---disable_query_log
-eval SELECT "$last_error" AS Last_SQL_Error;
---enable_query_log
-
-SELECT * FROM rpl_backup_block.t1;
+#
+# BUG#44830 : SLAVE START no longer results in error if RESTORE is running on master
+#
+#--echo # Connecting to slave 2...
+#connection slave2;
+#
+#STOP SLAVE;
+#--source include/wait_for_slave_to_stop.inc
+#
+#SET global sql_slave_skip_counter=1;
+#
+#START SLAVE;
+#--source include/wait_for_slave_to_start.inc
+#
+## Sync with master to ensure nothing is replicated after incident event.
+#sync_with_master;
+#
+#--replace_result $MASTER_MYPORT MASTER_PORT
+#--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 16 # 21 # 22 # 23 # 33 # 35 # 36 #
+#--query_vertical SHOW SLAVE STATUS
+#
+#--echo # Show the slave started without an error.
+#LET $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+#--disable_query_log
+#eval SELECT "$last_error" AS Last_SQL_Error;
+#--enable_query_log
 
 --echo #
 --echo # Cleanup
@@ -234,15 +239,18 @@ connection slave;
 SLAVE STOP;
 --source include/wait_for_slave_to_stop.inc
 
---echo # Connecting to slave 2...
-connection slave2;
-
---echo # Now stop the slave.
-SLAVE STOP;
---source include/wait_for_slave_to_stop.inc
-
---echo # Reset slave 2's backupdir.
-SET @@global.backupdir = DEFAULT;
+#
+# BUG#44830 : SLAVE START no longer results in error if RESTORE is running on master
+#
+#--echo # Connecting to slave 2...
+#connection slave2;
+#
+#--echo # Now stop the slave.
+#SLAVE STOP;
+#--source include/wait_for_slave_to_stop.inc
+#
+#--echo # Reset slave 2's backupdir.
+#SET @@global.backupdir = DEFAULT;
 
 --echo # Connecting to master...
 connection master;

Thread
bzr commit into mysql-6.0-backup branch (charles.bell:2809) Bug#44830Chuck Bell12 May