List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:November 2 2009 9:46am
Subject:Re: bzr commit into mysql-6.0-codebase-bugfixing branch
(Li-Bing.Song:3649) Bug#47699
View as plain text  
Hi Libing,

Nice work, I have some comments.

Li-Bing.Song@stripped wrote:
> #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);

I think you only need move the block below before the above two
statements.

>  
> -  /*
> -    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;
> 


-- 
MySQL Code Commits Mailing List
For list archives: http://lists.mysql.com/commits
To unsubscribe:    http://lists.mysql.com/commits?unsub=1

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