List:Commits« Previous MessageNext Message »
From:daogang.qu Date:January 12 2011 8:33am
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-12
      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_manual_change_index_file.result
      mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
=== 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-12 08:32:57 +0000
@@ -32,34 +32,16 @@ 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';
-[ on slave ]
-CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000002';
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+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.
-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';
-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;
-c1
-DROP TABLE t1;
+include/wait_for_slave_io_to_stop.inc
+Last_IO_Errno
+1236
+CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000002';
+START SLAVE;
+include/wait_for_slave_to_start.inc
 include/rpl_end.inc

=== 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-12 08:32:57 +0000
@@ -1,3 +1,4 @@
+source include/not_windows.inc;
 source include/master-slave.inc;
 
 #
@@ -116,88 +117,47 @@ sync_slave_with_master;
 --echo [ on master ]
 connection master;
 
-let $MASTER_DATADIR= `SELECT @@DATADIR`;
-
 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;
+STOP SLAVE;
+source include/wait_for_slave_to_stop.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';
+#This operation will result in error EE_FILENOTFOUND which happens 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';
+CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000001';
 START SLAVE IO_THREAD;
+source include/wait_for_slave_io_to_stop.inc;
 
---echo # Instead of EE_FILENOTFOUND, ER_MASTER_FATAL_ERROR_READING_BINLOG and the
---echo # 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;
+# Instead of EE_FILENOTFOUND, ER_MASTER_FATAL_ERROR_READING_BINLOG and the
+# specific information are sent to slave.
+let $field= Last_IO_Errno;
+let $show_statement= SHOW SLAVE STATUS;
+let $connection= = '1236';
+source include/wait_show_condition.inc;
+let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
+echo Last_IO_Errno;
+echo $last_io_errno;
 
-
---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';
+#This operation will result in error EE_FILENOTFOUND which happens when slave IO thread is connecting to master.
+move_file $MASTER_DATADIR/master-bin.bak $MASTER_DATADIR/master-bin.000001;
 
-CREATE TABLE t1(c1 INT);
-sync_slave_with_master;
---echo [ on slave ]
-SELECT * FROM t1;
+connection slave;
+CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000002';
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
 
-connection master;
-DROP TABLE t1;
 --source include/rpl_end.inc
+


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