List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:February 27 2008 6:46pm
Subject:bk commit into 5.1 tree (svoj:1.2531) BUG#13861
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of svoj.  When svoj does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-02-27 21:46:06+04:00, svoj@stripped +6 -0
  BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if
              log-slave-updates and circul repl
  
  After merge fixes.

  mysql-test/include/wait_for_slave_sql_to_stop.inc@stripped, 2008-02-27 21:46:03+04:00,
svoj@stripped +4 -1
    Do not change connection if it was requested by caller (needed for
    circular replication tests).

  mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt@stripped, 2008-02-27 21:39:45+04:00,
svoj@stripped +0 -0
    Rename: mysql-test/t/rpl_dual_pos_advance-slave.opt ->
mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt

  mysql-test/suite/rpl/t/rpl_dual_pos_advance.test@stripped, 2008-02-27 21:46:03+04:00,
svoj@stripped +5 -4
    Let include/wait_for_slave_sql_to_stop.inc know that we do not want to
    change connection to slave.

  sql/rpl_rli.cc@stripped, 2008-02-27 21:46:03+04:00, svoj@stripped +7 -2
    After merge fix.

  sql/rpl_rli.h@stripped, 2008-02-27 21:46:03+04:00, svoj@stripped +1 -1
    After merge fix.

  sql/slave.cc@stripped, 2008-02-27 21:46:03+04:00, svoj@stripped +2 -2
    After merge fix.

diff -Nrup a/mysql-test/include/wait_for_slave_sql_to_stop.inc
b/mysql-test/include/wait_for_slave_sql_to_stop.inc
--- a/mysql-test/include/wait_for_slave_sql_to_stop.inc	2007-06-19 16:06:09 +05:00
+++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc	2008-02-27 21:46:03 +04:00
@@ -9,7 +9,10 @@
 #         sql threads to stop
 #      3) If loops too long die.
 ####################################################
-connection slave;
+if (!$keep_connection)
+{
+  connection slave;
+}
 let $row_number= 1;
 let $run= 1;
 let $counter= 300;
diff -Nrup a/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt	2008-02-27 21:39:45 +04:00
@@ -0,0 +1 @@
+--innodb
diff -Nrup a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
--- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test	2008-02-27 17:43:52 +04:00
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test	2008-02-27 21:46:03 +04:00
@@ -12,6 +12,7 @@ source include/have_innodb.inc;
 
 # set up "dual head"
 
+let $keep_connection= 1;
 connection slave;
 reset master;
 
@@ -67,11 +68,11 @@ connection master;
 start slave until master_log_file="slave-bin.000001",master_log_pos=195;
 
 # wait until it's started (the position below is the start of "CREATE
-# TABLE t2") (otherwise wait_for_slave_to_stop may return at once)
+# TABLE t2") (otherwise wait_for_slave_sql_to_stop may return at once)
 
 select master_pos_wait("slave-bin.000001",137);
 
---source include/wait_for_slave_to_stop.inc
+--source include/wait_for_slave_sql_to_stop.inc
 
 # then BUG#13861 causes t3 to show up below (because stopped too
 # late).
@@ -80,12 +81,12 @@ show tables;
 
 # ensure that we do not break set @a=1; insert into t3 values(@a);
 start slave until master_log_file="slave-bin.000001",master_log_pos=438;
---source include/wait_for_slave_to_stop.inc
+--source include/wait_for_slave_sql_to_stop.inc
 select * from t3;
 
 # ensure that we do not break transaction
 start slave until master_log_file="slave-bin.000001",master_log_pos=663;
---source include/wait_for_slave_to_stop.inc
+--source include/wait_for_slave_sql_to_stop.inc
 select * from t3;
 
 start slave;
diff -Nrup a/mysql-test/t/rpl_dual_pos_advance-slave.opt
b/mysql-test/t/rpl_dual_pos_advance-slave.opt
--- a/mysql-test/t/rpl_dual_pos_advance-slave.opt	2008-02-22 19:07:06 +04:00
+++ /dev/null	Wed Dec 31 16:00:00 196900
@@ -1 +0,0 @@
---innodb
diff -Nrup a/sql/rpl_rli.cc b/sql/rpl_rli.cc
--- a/sql/rpl_rli.cc	2008-02-11 20:56:45 +04:00
+++ b/sql/rpl_rli.cc	2008-02-27 21:46:03 +04:00
@@ -955,6 +955,11 @@ err:
      Check if condition stated in UNTIL clause of START SLAVE is reached.
    SYNOPSYS
      Relay_log_info::is_until_satisfied()
+     master_beg_pos    position of the beginning of to be executed event
+                       (not log_pos member of the event that points to the
+                        beginning of the following event)
+
+
    DESCRIPTION
      Checks if UNTIL condition is reached. Uses caching result of last
      comparison of current log file name and target log file name. So cached
@@ -979,7 +984,7 @@ err:
      false - condition not met
 */
 
-bool Relay_log_info::is_until_satisfied()
+bool Relay_log_info::is_until_satisfied(my_off_t master_beg_pos)
 {
   const char *log_name;
   ulonglong log_pos;
@@ -990,7 +995,7 @@ bool Relay_log_info::is_until_satisfied(
   if (until_condition == UNTIL_MASTER_POS)
   {
     log_name= group_master_log_name;
-    log_pos= group_master_log_pos;
+    log_pos= master_beg_pos;
   }
   else
   { /* until_condition == UNTIL_RELAY_POS */
diff -Nrup a/sql/rpl_rli.h b/sql/rpl_rli.h
--- a/sql/rpl_rli.h	2008-02-11 20:56:45 +04:00
+++ b/sql/rpl_rli.h	2008-02-27 21:46:03 +04:00
@@ -296,7 +296,7 @@ public:
   void close_temporary_tables();
 
   /* Check if UNTIL condition is satisfied. See slave.cc for more. */
-  bool is_until_satisfied();
+  bool is_until_satisfied(my_off_t master_beg_pos);
   inline ulonglong until_pos()
   {
     return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos :
diff -Nrup a/sql/slave.cc b/sql/slave.cc
--- a/sql/slave.cc	2008-02-27 17:43:52 +04:00
+++ b/sql/slave.cc	2008-02-27 21:46:03 +04:00
@@ -1990,7 +1990,7 @@ static int exec_relay_log_event(THD* thd
       This tests if the position of the beginning of the current event
       hits the UNTIL barrier.
     */
-    if (rli->until_condition != RELAY_LOG_INFO::UNTIL_NONE &&
+    if (rli->until_condition != Relay_log_info::UNTIL_NONE &&
         rli->is_until_satisfied((rli->is_in_group() || !ev->log_pos) ?
                                 rli->group_master_log_pos :
                                 ev->log_pos - ev->data_written))
@@ -2648,7 +2648,7 @@ Slave SQL thread aborted. Can't execute 
     do not want to wait for next event in this case.
   */
   pthread_mutex_lock(&rli->data_lock);
-  if (rli->until_condition != RELAY_LOG_INFO::UNTIL_NONE &&
+  if (rli->until_condition != Relay_log_info::UNTIL_NONE &&
       rli->is_until_satisfied(rli->group_master_log_pos))
   {
     char buf[22];
Thread
bk commit into 5.1 tree (svoj:1.2531) BUG#13861Sergey Vojtovich27 Feb 2008