List:Commits« Previous MessageNext Message »
From:daogang.qu Date:January 13 2011 10:28am
Subject:bzr commit into mysql-trunk branch (daogang.qu:3214) WL#5493
View as plain text  
#At file:///home/daogang/bzrwork/mysql-trunk-wl5493/ based on revid:daogang.qu@stripped

 3214 daogang.qu@stripped	2011-01-13
      WL#5493 Binlog crash-safe when master crashed
      
      Post fix.
     @ mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
        Upadated for the patch of WL#5493.
     @ mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
        In fact, PURGE can't update log file name which is appended by append_file
        into the IO_CACHE of index file. PURGE did it in the test case because
        the IO_CACHE can't be cleared rightly before the patch of WL#5493.
        Then the test didn't work fine. So we have to use the above alternative
        to reproduce the problem.

    modified:
      mysql-test/suite/rpl/r/rpl_crash_safe_master.result
      mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
      mysql-test/suite/rpl/t/rpl_crash_safe_master.test
      mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
=== modified file 'mysql-test/suite/rpl/r/rpl_crash_safe_master.result'
--- a/mysql-test/suite/rpl/r/rpl_crash_safe_master.result	2010-12-22 03:31:50 +0000
+++ b/mysql-test/suite/rpl/r/rpl_crash_safe_master.result	2011-01-13 10:28:28 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 include/stop_slave.inc
 RESET MASTER;
 include/start_slave.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_manual_change_index_file.result'
--- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result	2011-01-13 10:28:28 +0000
@@ -32,31 +32,27 @@ call mtr.add_suppression("Got fatal erro
 CREATE TABLE t1(c1 int);
 DROP TABLE t1;
 FLUSH LOGS;
-FLUSH LOGS;
 CREATE TABLE t2(c1 int);
 DROP TABLE t2;
 [ on slave ]
 include/stop_slave.inc
 [ on master ]
-# Remove master-bin.000001 and master-bin.000002 from index file.
-PURGE MASTER LOGS TO 'master-bin.000003';
-# Re-insert master-bin.000002 into index file manually.
-# PURGE is used to update IO_CACHE of index file.  After this statement,
-# master knows that master-bin.000002 is in index file.
-PURGE MASTER LOGS TO 'master-bin.000002';
+# This operation will result in error EE_FILENOTFOUND which happens
+# when slave IO thread is connecting to master.
 [ on slave ]
-CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000002';
+CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000001';
 START SLAVE IO_THREAD;
-# Instead of EE_FILENOTFOUND, ER_MASTER_FATAL_ERROR_READING_BINLOG and the
-# specific information are sent to slave.
+# Instead of EE_FILENOTFOUND, ER_MASTER_FATAL_ERROR_READING_BINLOG
+# and the specific information are sent to slave.
 include/wait_for_slave_io_error.inc [errno=1236]
 Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Could not open log file''
-CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000003';
+[ on master ]
+# This operation will result in error EE_FILENOTFOUND which happens
+# when slave IO thread is connecting to master.
+[ on slave ]
+CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000002';
 include/start_slave.inc
 [ on master ]
-# Restore the correct index file.
-FLUSH LOGS;
-PURGE MASTER LOGS TO 'master-bin.000004';
 CREATE TABLE t1(c1 INT);
 [ on slave ]
 SELECT * FROM t1;

=== modified file 'mysql-test/suite/rpl/t/rpl_crash_safe_master.test'
--- a/mysql-test/suite/rpl/t/rpl_crash_safe_master.test	2010-12-22 03:31:50 +0000
+++ b/mysql-test/suite/rpl/t/rpl_crash_safe_master.test	2011-01-13 10:28:28 +0000
@@ -35,14 +35,12 @@
 # Reset master
 connection slave;
 --source include/stop_slave.inc 
---source include/wait_for_slave_to_stop.inc
 
 connection master;
 RESET MASTER;
 
 connection slave;
 --source include/start_slave.inc
---source include/wait_for_slave_to_start.inc
 
 connection master;
 call mtr.add_suppression("Attempting backtrace");
@@ -56,7 +54,6 @@ CREATE TABLE t1(a LONGBLOB) ENGINE=INNOD
 
 -- echo # Test case1: Set DEBUG POINT before binlog to make
 -- echo #             the master crash for transaction
-#SET SESSION debug="d,crash_trans_commit_before_binlog";
 BEGIN;
 let $rows= 3;
 WHILE($rows)
@@ -94,7 +91,6 @@ connection master;
 -- let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
 -- echo # Test case2: Set DEBUG POINT after binlog, and before the date
 -- echo #             is committed to make crash for transaction
-#SET SESSION debug="d,crash_trans_commit_after_binlog";
 BEGIN;
 let $rows= 3;
 WHILE($rows)
@@ -129,7 +125,6 @@ SELECT COUNT(*) FROM t1;
 connection master;
 DROP TABLE t1;
 sync_slave_with_master;
-
 -- source include/stop_slave.inc
 
 connection master;

=== modified file 'mysql-test/suite/rpl/t/rpl_manual_change_index_file.test'
--- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test	2011-01-13 10:28:28 +0000
@@ -1,3 +1,4 @@
+source include/not_windows.inc;
 source include/master-slave.inc;
 
 #
@@ -113,86 +114,50 @@ sync_slave_with_master;
 --echo # I/O thread stops immediately.
 
 --source include/rpl_reset.inc
---echo [ on master ]
 connection master;
-
-let $MASTER_DATADIR= `SELECT @@DATADIR`;
-
+--echo [ on master ]
 call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log:");
+let $MASTER_DATADIR= `SELECT @@DATADIR`;
 CREATE TABLE t1(c1 int);
 DROP TABLE t1;
 
 FLUSH LOGS;
-FLUSH LOGS;
 
 CREATE TABLE t2(c1 int);
 DROP TABLE t2;
 sync_slave_with_master;
-
 --echo [ on slave ]
 source include/stop_slave.inc;
 
---echo [ on master ]
 connection master;
---echo # Remove master-bin.000001 and master-bin.000002 from index file.
-PURGE MASTER LOGS TO 'master-bin.000003';
-
---echo # Re-insert master-bin.000002 into index file manually.
-if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
-{
-append_file $MASTER_DATADIR/master-bin.index;
-./master-bin.000002
-EOF
-sleep 0.00000001;
-}
-if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
-{
-append_file $MASTER_DATADIR/master-bin.index;
-.\master-bin.000002
-EOF
-sleep 0.00000001;
-}
---echo # PURGE is used to update IO_CACHE of index file.  After this statement,
---echo # master knows that master-bin.000002 is in index file.
-PURGE MASTER LOGS TO 'master-bin.000002';
+--echo [ on master ]
+--echo # This operation will result in error EE_FILENOTFOUND which happens
+--echo # when slave IO thread is connecting to master.
+move_file $MASTER_DATADIR/master-bin.000001 $MASTER_DATADIR/master-bin.bak;
 
---echo [ on slave ]
 connection slave;
-CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000002';
+--echo [ on slave ]
+CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000001';
 START SLAVE IO_THREAD;
-
---echo # Instead of EE_FILENOTFOUND, ER_MASTER_FATAL_ERROR_READING_BINLOG and the
---echo # specific information are sent to slave.
+--echo # Instead of EE_FILENOTFOUND, ER_MASTER_FATAL_ERROR_READING_BINLOG
+--echo # and the specific information are sent to slave.
 let $slave_io_errno= 1236;
 let $show_slave_io_error= 1;
 source include/wait_for_slave_io_error.inc;
 
-CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000003';
-source include/start_slave.inc;
+connection master;
+--echo [ on master ]
+--echo # This operation will result in error EE_FILENOTFOUND which happens
+--echo # when slave IO thread is connecting to master.
+move_file $MASTER_DATADIR/master-bin.bak $MASTER_DATADIR/master-bin.000001;
 
+connection slave;
+--echo [ on slave ]
+CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000002';
+source include/start_slave.inc;
 
---echo [ on master ]
 connection master;
---echo # Restore the correct index file.
-let $file= $MASTER_DATADIR/master-bin.index;
-source include/truncate_file.inc;
-if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
-{
-append_file $MASTER_DATADIR/master-bin.index;
-./master-bin.000003
-EOF
-sleep 0.00000001;
-}
-if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
-{
-append_file $MASTER_DATADIR/master-bin.index;
-.\master-bin.000003
-EOF
-sleep 0.00000001;
-}
-FLUSH LOGS;
-PURGE MASTER LOGS TO 'master-bin.000004';
-
+--echo [ on master ]
 CREATE TABLE t1(c1 INT);
 sync_slave_with_master;
 --echo [ on slave ]
@@ -200,4 +165,6 @@ SELECT * FROM t1;
 
 connection master;
 DROP TABLE t1;
+
 --source include/rpl_end.inc
+


Attachment: [text/bzr-bundle] bzr/daogang.qu@greatopensource.com-20110113102828-4m7v56snrhm44u1n.bundle
Thread
bzr commit into mysql-trunk branch (daogang.qu:3214) WL#5493daogang.qu13 Jan