List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:May 4 2010 9:41am
Subject:bzr commit into mysql-5.1-bugteam branch (alfranio.correia:3368)
Bug#43407
View as plain text  
#At file:///home/acorreia/workspace.sun/repository.mysql/bzrwork/bug-43406/mysql-5.1-bugteam/ based on revid:alfranio.correia@stripped

 3368 Alfranio Correia	2010-05-04
      BUG#43407 SET GLOBAL SQL_SLAVE_SKIP_COUNTER should log previous state in error log
            
      When issuing a 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER' statement, the previous
      position along with the new position is dumped into the error log. Namely,
      the following information is printed out: skip_counter, group_relay_log_name
      and group_relay_log_pos.

    modified:
      sql/slave.cc
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2010-03-19 09:06:40 +0000
+++ b/sql/slave.cc	2010-05-04 09:41:28 +0000
@@ -2883,6 +2883,11 @@ pthread_handler_t handle_slave_sql(void 
 {
   THD *thd;                     /* needs to be first for thread_stack */
   char llbuff[22],llbuff1[22];
+  char saved_log_name[FN_REFLEN];
+  char saved_master_log_name[FN_REFLEN];
+  my_off_t saved_log_pos;
+  my_off_t saved_master_log_pos;
+  my_off_t saved_skip= 0;
 
   Relay_log_info* rli = &((Master_info*)arg)->rli;
   const char *errmsg;
@@ -3028,6 +3033,17 @@ log '%s' at position %s, relay log '%s' 
     do not want to wait for next event in this case.
   */
   pthread_mutex_lock(&rli->data_lock);
+  if (rli->slave_skip_counter)
+  {
+    char *pos;
+    pos= strmake(saved_log_name, rli->group_relay_log_name, FN_REFLEN - 1);
+    pos= '\0';
+    pos= strmake(saved_master_log_name, rli->group_master_log_name, FN_REFLEN - 1);
+    pos= '\0';
+    saved_log_pos= rli->group_relay_log_pos;
+    saved_master_log_pos= rli->group_master_log_pos;
+    saved_skip= rli->slave_skip_counter;
+  }
   if (rli->until_condition != Relay_log_info::UNTIL_NONE &&
       rli->is_until_satisfied(thd, NULL))
   {
@@ -3046,6 +3062,21 @@ log '%s' at position %s, relay log '%s' 
     thd_proc_info(thd, "Reading event from the relay log");
     DBUG_ASSERT(rli->sql_thd == thd);
     THD_CHECK_SENTRY(thd);
+
+    if (saved_skip && rli->slave_skip_counter == 0)
+    {
+      sql_print_information("'SQL_SLAVE_SKIP_COUNTER=%ld' executed at "
+        "relay_log_file='%s', relay_log_pos='%ld', master_log_name='%s', "
+        "master_log_pos='%ld' and new position at "
+        "relay_log_file='%s', relay_log_pos='%ld', master_log_name='%s', "
+        "master_log_pos='%ld' ",
+        (ulong) saved_skip, saved_log_name, (ulong) saved_log_pos,
+        saved_master_log_name, (ulong) saved_master_log_pos,
+        rli->group_relay_log_name, (ulong) rli->group_relay_log_pos,
+        rli->group_master_log_name, (ulong) rli->group_master_log_pos);
+      saved_skip= 0;
+    }
+    
     if (exec_relay_log_event(thd,rli))
     {
       DBUG_PRINT("info", ("exec_relay_log_event() failed"));


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-5.1-bugteam branch (alfranio.correia:3368)Bug#43407Alfranio Correia4 May