MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Li-Bing.Song Date:October 26 2009 6:00am
Subject:bzr commit into mysql-6.0-codebase-bugfixing branch (Li-Bing.Song:3649)
Bug#47699
View as plain text  
#At file:///home/anders/work/bzrwork/worktree5/mysql-6.0-codebase-bugfixing/ based on revid:alik@ibmvm-20091008093643-fjns7fky4mc00jfw

 3649 Li-Bing.Song@stripped	2009-10-26
      Bug#47699  	rpl.rpl_backup_block fails sporadically
      
      After 'START SLAVE' is executed, An unexpected error 'RESTORE_ON_MASTER' 
      appears in Last_Error. On Slave, The Last_Error is cleared after 
      'START SLAVE [SQL_THREAD]' has returned. 'SHOW SLAVE STATUS' sometimes is 
      executed earlier than that Last_Error is cleared. So the last error which 
      has happened before 'START SLAVE' still appears in the slave status.
      
      This patch wrote code to clear error before 'START SLAVE [SQL_THREAD]' returns.

    modified:
      sql/slave.cc
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-10-01 23:15:18 +0000
+++ b/sql/slave.cc	2009-10-26 06:00:33 +0000
@@ -3162,6 +3162,18 @@ pthread_handler_t handle_slave_sql(void 
   rli->slave_run_id++;
   rli->slave_running = 1;
 
+  /*
+    Reset errors for a clean start (otherwise, if the master is idle, the SQL
+    thread may execute no Query_log_event, so the error will remain even
+    though there's no problem anymore). Do not reset the master timestamp
+    (imagine the slave has caught everything, the STOP SLAVE and START SLAVE:
+    as we are not sure that we are going to receive a query, we want to
+    remember the last master timestamp (to say how many seconds behind we are
+    now.
+    But the master timestamp is reset by RESET SLAVE & CHANGE MASTER.
+  */
+  rli->clear_error();
+
   pthread_detach_this_thread();
   if (init_slave_thread(thd, SLAVE_THD_SQL))
   {
@@ -3193,18 +3205,6 @@ pthread_handler_t handle_slave_sql(void 
   pthread_mutex_unlock(&rli->run_lock);
   pthread_cond_broadcast(&rli->start_cond);
 
-  /*
-    Reset errors for a clean start (otherwise, if the master is idle, the SQL
-    thread may execute no Query_log_event, so the error will remain even
-    though there's no problem anymore). Do not reset the master timestamp
-    (imagine the slave has caught everything, the STOP SLAVE and START SLAVE:
-    as we are not sure that we are going to receive a query, we want to
-    remember the last master timestamp (to say how many seconds behind we are
-    now.
-    But the master timestamp is reset by RESET SLAVE & CHANGE MASTER.
-  */
-  rli->clear_error();
-
   //tell the I/O thread to take relay_log_space_limit into account from now on
   pthread_mutex_lock(&rli->log_space_lock);
   rli->ignore_log_space_limit= 0;


Attachment: [text/bzr-bundle] bzr/li-bing.song@sun.com-20091026060033-541vsezr4wva6b5s.bundle
Thread
bzr commit into mysql-6.0-codebase-bugfixing branch (Li-Bing.Song:3649)Bug#47699Li-Bing.Song26 Oct
  • Re: bzr commit into mysql-6.0-codebase-bugfixing branch(Li-Bing.Song:3649) Bug#47699He Zhenxing30 Oct
  • Re: bzr commit into mysql-6.0-codebase-bugfixing branch(Li-Bing.Song:3649) Bug#47699He Zhenxing2 Nov