# Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: li-bing.song@sun.com-20101108103009-0t1o32dcl4htgdcy # target_branch: file:///home/anders/Work/bzrroot/mysql-next-mr-\ # bugfixing/ # testament_sha1: 9957607f404acc0e12784eba26f19ce635cd7bf9 # timestamp: 2010-11-09 19:37:27 +0800 # base_revision_id: horst.hunger@sun.com-20101028193912-\ # 9mze2ondkqamki2a # # Begin patch === modified file 'mysql-test/suite/rpl/r/rpl_slave_status.result' --- mysql-test/suite/rpl/r/rpl_slave_status.result 2008-07-10 16:09:39 +0000 +++ mysql-test/suite/rpl/r/rpl_slave_status.result 2010-11-08 10:30:09 +0000 @@ -29,7 +29,32 @@ START SLAVE; ==== Verify that Slave_IO_Running = No ==== Slave_IO_Running = No (should be No) -==== Cleanup (Note that slave IO thread is not running) ==== -DROP TABLE t1; +==== Cleanup ==== +[on master] +DROP TABLE t1; +[on slave] +include/stop_slave.inc +CHANGE MASTER TO master_user='root', master_password=''; +include/start_slave.inc + +# Bug#47699 rpl.rpl_backup_block fails sporadically +# +# START SLAVE released the lock and returned before it cleared the error, +# so there is a possibility that Slave_SQL_Error is not 0. +[on slave] +CALL mtr.add_suppression("Slave: Table 't1' already exists Error_code: 1050"); +# The statement makes SQL thread to fail. +CREATE TABLE t1(c1 INT); +[on master] +CREATE TABLE t1(c1 INT); +[on slave] +DROP TABLE t1; +# Block SQL thread immediately after it starts. +SET GLOBAL debug="d,after_start_slave"; +START SLAVE SQL_THREAD; +# Check Slave_SQL_Error, there should not be an error. +# Resume SQL thread +SET DEBUG_SYNC="now SIGNAL signal.continue"; +SET GLOBAL debug= $debug_save; [on master] DROP TABLE t1; === modified file 'mysql-test/suite/rpl/t/rpl_slave_status.test' --- mysql-test/suite/rpl/t/rpl_slave_status.test 2009-10-02 09:24:21 +0000 +++ mysql-test/suite/rpl/t/rpl_slave_status.test 2010-11-08 10:30:09 +0000 @@ -60,11 +60,53 @@ let $result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); --echo Slave_IO_Running = $result (should be No) ---echo ==== Cleanup (Note that slave IO thread is not running) ==== -DROP TABLE t1; -# cleanup: slave io thread has been stopped "irrecoverably" -# so we clean up mess manually - ---echo [on master] -connection master; -DROP TABLE t1; +--echo ==== Cleanup ==== +--echo [on master] +connection master; +DROP TABLE t1; + +--echo [on slave] +connection slave; +source include/stop_slave.inc; +CHANGE MASTER TO master_user='root', master_password=''; +source include/start_slave.inc; +connection master; +sync_slave_with_master; + +--echo +--echo # Bug#47699 rpl.rpl_backup_block fails sporadically +--echo # +--echo # START SLAVE released the lock and returned before it cleared the error, +--echo # so there is a possibility that Slave_SQL_Error is not 0. + +--echo [on slave] +CALL mtr.add_suppression("Slave: Table 't1' already exists Error_code: 1050"); +--echo # The statement makes SQL thread to fail. +CREATE TABLE t1(c1 INT); + +--echo [on master] +connection master; +CREATE TABLE t1(c1 INT); + +--echo [on slave] +connection slave; +source include/wait_for_slave_sql_to_stop.inc; + +DROP TABLE t1; + +--echo # Block SQL thread immediately after it starts. +let $debug_save=`SELECT @@debug`; +SET GLOBAL debug="d,after_start_slave"; +START SLAVE SQL_THREAD; +source include/wait_for_slave_sql_to_start.inc; +--echo # Check Slave_SQL_Error, there should not be an error. +source include/check_slave_no_error.inc; + +--echo # Resume SQL thread +SET DEBUG_SYNC="now SIGNAL signal.continue"; +SET GLOBAL debug= $debug_save; + +--echo [on master] +connection master; +DROP TABLE t1; +source include/master-slave-end.inc; === modified file 'sql/rpl_slave.cc' --- sql/rpl_slave.cc 2010-10-27 10:31:46 +0000 +++ sql/rpl_slave.cc 2010-11-08 10:30:09 +0000 @@ -3465,8 +3465,6 @@ Seconds_Behind_Master grows. No big deal. */ rli->abort_slave = 0; - mysql_mutex_unlock(&rli->run_lock); - mysql_cond_broadcast(&rli->start_cond); /* Reset errors for a clean start (otherwise, if the master is idle, the SQL @@ -3480,6 +3478,19 @@ */ rli->clear_error(); + mysql_mutex_unlock(&rli->run_lock); + mysql_cond_broadcast(&rli->start_cond); + + DBUG_EXECUTE_IF("after_start_slave", + { + const char act[]= + "now " + "wait_for signal.continue"; + DBUG_ASSERT(opt_debug_sync_timeout > 0); + DBUG_ASSERT(!debug_sync_set_action(current_thd, + STRING_WITH_LEN(act))); + };); + //tell the I/O thread to take relay_log_space_limit into account from now on mysql_mutex_lock(&rli->log_space_lock); rli->ignore_log_space_limit= 0; # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWY1Q5xsABCH/gEARUAB95/// f+f/6v////pgCo4Hyy0ugAzpiMsoOjIokLrJAwkoTRGgT0nqaaG1PU9IA0AAAAAaNAGg1E0jQbUD TTT1AAAAAAAAAAAcwmjI0NDIYRoZDTRoAMRkyAYQDAJEhNEyJhTYQKZ5KYyJtJppkAzRPUaaNHqe gmhzCaMjQ0MhhGhkNNGgAxGTIBhAMAkkE0aBGTIAETamJqam0xTag00AAaAeUThlnQxGKxH5aycq 6+NqvzflM8M2iaNf0luCs+pG1zJMhsMD3rnFIponvsPftDllD5duvpOHDK3KsoHH7EE2u+zHKCiM GFVJkC49j2QS05ctttc99vRdKovfl39SXI0IuAY18pAcRs/gz8a2LMm22DfcsP99wRSvET4fFpcn YuFnDonS6KN1cPsM+Hq2i7ZfI4BheHGWGsmHU1rOstKqV9pKFpsJB0o9ZrO5aZhXr4d88hGRYKMh uq1CN3pDN1vDEoMCJFb1IHPFfeFBWskNMMEh6Cs/aWGw9Sompk4J/4KvNUKIdygSmWgYl1asJFaB pivUbDBk7AqGttFEqfy+3Dr6Q+t/uznNmn3ayW67XMyc4mizIpJeVpD8OVttsYxt6k1PKhCWCcaP M6Y6aIu6mD4or0O5s3HjpalBAMfMppBqcSgFsRcKA+gD6i2VOohgh3KAT4+NbZXI8vmOwNxtwkVy XebZZeaJOTizbMyqzLDEoUuCmJWE7/hCBWqVIQ5c1Cd7gZMK7T4UAG6GUSAfEf1NyNQh75KA0jEU FMGC4jsKSRjLYQqstoe/FMkDngEGonAhi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