List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:February 27 2008 4:24pm
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 19:24:00+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_to_stop.inc@stripped, 2008-02-27 19:23:55+04:00,
svoj@stripped +12 -6
    - do not change connection if it was requested by caller
      (keep_connection)
    - do not wait for slave io thread to finish if it was requested by caller
      (skip_slave_io_check)
    
    This is needed for circular replication tests.

  mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt@stripped, 2008-02-27 18:08:02+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 19:23:55+04:00,
svoj@stripped +2 -0
    Let include/wait_for_slave_to_stop.inc know that we do not want to
    change connection to slave and wait for slave io thread to stop.

  sql/rpl_rli.cc@stripped, 2008-02-27 19:23:56+04:00, svoj@stripped +7 -2
    After merge fix.

  sql/rpl_rli.h@stripped, 2008-02-27 19:23:56+04:00, svoj@stripped +1 -1
    After merge fix.

  sql/slave.cc@stripped, 2008-02-27 19:23:56+04:00, svoj@stripped +2 -2
    After merge fix.

diff -Nrup a/mysql-test/include/wait_for_slave_to_stop.inc
b/mysql-test/include/wait_for_slave_to_stop.inc
--- a/mysql-test/include/wait_for_slave_to_stop.inc	2007-07-30 16:32:03 +05:00
+++ b/mysql-test/include/wait_for_slave_to_stop.inc	2008-02-27 19:23:55 +04:00
@@ -10,18 +10,24 @@
 #         io and 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;
 
 while ($run)
 {
-  let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
-  if (`SELECT '$io_result' = 'No'`){
-
-    let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running,
$row_number);
-    if (`SELECT '$sql_result' = 'No'`){
+  let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
+  if (`SELECT '$sql_result' = 'No'`){
+    if ($skip_slave_io_check)
+    {
+      let $run= 0;
+    }
+    let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
+    if (`SELECT '$io_result' = 'No'`){
       let $run= 0;
     }
   }
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 18:08:02 +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 19:23:55 +04:00
@@ -12,6 +12,8 @@ source include/have_innodb.inc;
 
 # set up "dual head"
 
+let $keep_connection= 1;
+let $skip_slave_io_check= 1;
 connection slave;
 reset master;
 
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 19:23:56 +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 19:23:56 +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 19:23:56 +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