MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:July 8 2009 12:35pm
Subject:bzr commit into mysql-5.4 branch (aelkin:2813) Bug#45940
View as plain text  
#At file:///home/andrei/MySQL/BZR/mysql-azalea-alik/ based on revid:aelkin@stripped

 2813 Andrei Elkin	2009-07-08
      Bug #45940  	issues around rli->last_event_start_time
      
      post-reviewing patch with small improvements.
added:
  mysql-test/suite/rpl/r/rpl_stop_middle_group.result
modified:
  mysql-test/suite/rpl/t/rpl_stop_middle_group.test
  sql/slave.cc

per-file messages:
  mysql-test/suite/rpl/r/rpl_stop_middle_group.result
    the new results file is added.
  mysql-test/suite/rpl/t/rpl_stop_middle_group.test
    more comments added.
  sql/slave.cc
    Improved English for an error message.
=== added file 'mysql-test/suite/rpl/r/rpl_stop_middle_group.result'
--- a/mysql-test/suite/rpl/r/rpl_stop_middle_group.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stop_middle_group.result	2009-07-08 12:34:52 +0000
@@ -0,0 +1,61 @@
+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;
+create table tm (a int auto_increment primary key) engine=myisam;
+create table ti (a int auto_increment primary key) engine=innodb;
+set @@global.debug="+d,stop_slave_middle_group";
+begin;
+insert into ti set a=null;
+insert into tm set a=null;
+commit;
+SELECT "NO" AS Last_SQL_Error, @check as `true`;
+Last_SQL_Error	true
+NO	1
+select count(*) as one from tm;
+one
+1
+select count(*) as one from ti;
+one
+1
+set @@global.debug="-d";
+include/start_slave.inc
+truncate table tm;
+truncate table ti;
+set @@global.debug="+d,stop_slave_middle_group";
+set @@global.debug="+d,incomplete_group_in_relay_log";
+begin;
+insert into ti set a=null;
+insert into tm set a=null;
+commit;
+SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
+Last_SQL_Error	true
+Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details).	1
+select count(*) as one  from tm;
+one
+1
+select count(*) as zero from ti;
+zero
+0
+set @@global.debug="-d";
+stop slave;
+truncate table tm;
+include/start_slave.inc
+set @@global.debug="+d,stop_slave_middle_group";
+set @@global.debug="+d,incomplete_group_in_relay_log";
+update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
+SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
+Last_SQL_Error	true
+Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details).	1
+select max(a) as two from tm;
+two
+2
+select max(a) as one from ti;
+one
+1
+set @@global.debug="-d";
+drop table tm, ti;
+include/stop_slave.inc
+drop table tm, ti;

=== modified file 'mysql-test/suite/rpl/t/rpl_stop_middle_group.test'
--- a/mysql-test/suite/rpl/t/rpl_stop_middle_group.test	2009-07-06 13:46:31 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stop_middle_group.test	2009-07-08 12:34:52 +0000
@@ -6,6 +6,8 @@
 # does not have immediate effect if a non-transaction table has been changed.
 # The slave sql thread has to try to finish applying first.
 # The tests rely on simulation of the killed status.
+# The matter of testing correlates to some of `rpl_start_stop_slave' that does
+# not require `have_debug'.
 
 connection master;
 

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-07-06 13:46:31 +0000
+++ b/sql/slave.cc	2009-07-08 12:34:52 +0000
@@ -905,11 +905,12 @@ static bool sql_slave_killed(THD* thd, R
     if (thd->transaction.all.modified_non_trans_table && rli->is_in_group())
     {
       char msg_stopped[]=
-        "... slave SQL is stopped having the current group "
+        "... The slave SQL is stopped, leaving the current group "
         "of events unfinished with a non-transaction table changed. "
-        "If the group consists of Row-based events, you might like to"
-        "restart the slave in the Idempotent exec mode which ignores some "
-        "errors such as dup key, key-not-found some more (see docs).";
+        "If the group consists solely of Row-based events, you can try "
+        "restarting the slave with --slave-exec-mode=IDEMPOTENT, which "
+        "ignores duplicate key, key not found, and similar errors (see "
+        "documentation for details).";
 
       if (rli->abort_slave)
       {

Thread
bzr commit into mysql-5.4 branch (aelkin:2813) Bug#45940Andrei Elkin8 Jul