List:Commits« Previous MessageNext Message »
From:Li-Bing.Song Date:May 28 2010 3:09am
Subject:bzr commit into mysql-5.1-bugteam branch (Li-Bing.Song:3400) Bug#49741
View as plain text  
#At file:///home/anders/work/bzrwork1/wt1/mysql-5.1-bugteam/ based on revid:dlenev@stripped

 3400 Li-Bing.Song@stripped	2010-05-28
      Postfix for BUG#49741
      Add code to waiting for a set of errors.
      Add code to waiting for an error instead of waiting for io thread to stop, as
      after 'START SLAVE', the status of io thread is still not running.
      But it doesn't mean slave io thread encounters an error.

    modified:
      mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
      mysql-test/include/wait_for_slave_io_error.inc
      mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
=== modified file 'mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test'
--- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test	2010-05-24 13:54:08 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test	2010-05-28 02:57:45 +0000
@@ -68,19 +68,15 @@ eval SET DEBUG_SYNC=$debug_sync_action;
 
 # Show slave last IO errno
 connection slave;
-source include/wait_for_slave_io_to_stop.inc;
-let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
 --echo Check network error happened here
-if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST
-            '$last_io_errno' = '2003' || # CR_CONN_HOST_ERROR
-            '$last_io_errno' = '2002' || # CR_CONNECTION_ERROR
-            '$last_io_errno' = '2006' || # CR_SERVER_GONE_ERROR
-            '$last_io_errno' = '1040' || # ER_CON_COUNT_ERROR
-            '$last_io_errno' = '1053'    # ER_SERVER_SHUTDOWN
-            `)
-{
-  --echo NETWORK ERROR
-}
+# '2013' CR_SERVER_LOST 
+# '2003' CR_CONN_HOST_ERROR 
+# '2002' CR_CONNECTION_ERROR 
+# '2006' CR_SERVER_GONE_ERROR 
+# '1040' ER_CON_COUNT_ERROR 
+# '1053' ER_SERVER_SHUTDOWN
+let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013;
+source include/wait_for_slave_io_error.inc;
 
 # deactivate the sync point of get_master_version_and_clock()
 # now to avoid restarting IO-thread to re-enter it.

=== modified file 'mysql-test/include/wait_for_slave_io_error.inc'
--- a/mysql-test/include/wait_for_slave_io_error.inc	2010-05-24 13:54:08 +0000
+++ b/mysql-test/include/wait_for_slave_io_error.inc	2010-05-28 02:57:45 +0000
@@ -6,14 +6,21 @@
 #
 # ==== Usage ====
 #
+# # Wait several errors.  
+# let $slave_io_errno= 1, 2, 3; 
+# source include/wait_for_slave_io_error.inc;
+#
+# # Print error message 
+# let $slave_io_errno= 1; 
+# let $show_slave_io_error= 1; 
 # source include/wait_for_slave_io_error.inc;
 #
 # Parameters:
 #
 # $slave_io_errno
-#   The expected IO error number.  This is required.
+#   The expected IO error numbers.  This is required.
 #   (After BUG#41956 has been fixed, this will be required to be a
-#   symbolic name instead of a number.)
+#   symbolic name instead of a numbers.)
 #
 # $show_slave_io_error
 #   If set, will print the error to the query log.
@@ -28,13 +35,17 @@ if (`SELECT '$slave_io_errno' = ''`) {
   --die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc
 }
 
-let $slave_param= Slave_IO_Running;
-let $slave_param_value= No;
-let $slave_error_message= Failed while waiting for slave to stop the IO thread (expecting error in the IO thread);
+let $old_slave_param_comparison= $slave_param_comparison;
+let $slave_param= Last_IO_Errno;
+let $slave_param_comparison= !=;
+let $slave_param_value= 0;
+let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
 source include/wait_for_slave_param.inc;
+let $slave_error_message= ;
+let $slave_param_comparison= $old_slave_param_comparison;
 
 let $_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
-if (`SELECT '$_error' != '$slave_io_errno'`) {
+if (`SELECT $_error NOT IN ($slave_io_errno)`) {
   --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) ****
   source include/show_rpl_debug_info.inc;
   --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) ****

=== modified file 'mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result'
--- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result	2010-05-24 13:54:08 +0000
+++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result	2010-05-28 02:57:45 +0000
@@ -14,7 +14,6 @@ slave is going to hang in get_master_ver
 slave is unblocked
 SET DEBUG_SYNC='now SIGNAL signal.get_unix_timestamp';
 Check network error happened here
-NETWORK ERROR
 set @@global.debug = "-d,'debug_lock.before_get_UNIX_TIMESTAMP'";
 stop slave;
 SET @@global.debug= "+d,'debug_lock.before_get_SERVER_ID'";
@@ -23,7 +22,6 @@ slave is going to hang in get_master_ver
 slave is unblocked
 SET DEBUG_SYNC='now SIGNAL signal.get_server_id';
 Check network error happened here
-NETWORK ERROR
 set @@global.debug = "-d,'debug_lock.before_get_SERVER_ID'";
 set global debug= '';
 reset master;


Attachment: [text/bzr-bundle] bzr/li-bing.song@sun.com-20100528025745-zur4o99wtcu0rnw5.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (Li-Bing.Song:3400) Bug#49741Li-Bing.Song28 May