List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:September 6 2010 5:22pm
Subject:Re: bzr commit into mysql-5.5-bugfixing branch (alfranio.correia:3203)
Bug#55415
View as plain text  
Hi Luis,

On 09/06/2010 06:03 PM, Luís Soares wrote:
> Hi Alfranio,
>
>   Nice Work.
>   Please find my review comments below.
>
> STATUS
> ------
>
>   Approved (after considering RC1).
>
> REQUIRED CHANGES
> ----------------
>
>   RC1. I think you should move the enter_cond out of
>        wait_for_update_bin_log so that thd->exit_cond does not
>        appear out of the blue inside the outer loop.

I agree with you. Done.

>
>        Perhaps move it just before calling
>        wait_for_update_bin_log. And leave small a comment on
>        this piece of code.
>
> REQUESTS
> --------
>  n/a
>
> SUGGESTIONS
> -----------
>  n/a
>
> DETAILS
> -------
>  n/a
>
> On 09/03/2010 02:46 PM, Alfranio Correia wrote:
>> #At 
>>
> file:///home/acorreia/workspace.sun/repository.mysql.new/bzrwork/bug-55415/mysql-5.5-bugfixing/
> 
>> based on revid:wlad@stripped
>>
>>   3203 Alfranio Correia    2010-09-03 [merge]
>>        BUG#55415 wait_for_update_bin_log enters a condition but does 
>> not leave
>>
>>        In sql/log.c, member function wait_for_update_bin_log, a 
>> condition is entered with
>>        THD::enter_cond but is not exited. This might leave dangling 
>> references to the
>>        mutex/condition in the per-thread information area.
>>
>>        To fix the problem, we call exit_cond to properly remove 
>> references to the mutex,
>>        LOCK_log.
>>
>>      modified:
>>        sql/log.cc
>>        sql/sql_repl.cc
>> === modified file 'sql/log.cc'
>> --- a/sql/log.cc    2010-08-30 08:36:02 +0000
>> +++ b/sql/log.cc    2010-09-03 13:45:39 +0000
>> @@ -5284,11 +5284,10 @@ int MYSQL_BIN_LOG::wait_for_update_bin_l
>>                                              const struct timespec 
>> *timeout)
>>   {
>>     int ret= 0;
>> -  const char* old_msg = thd->proc_info;
>>     DBUG_ENTER("wait_for_update_bin_log");
>> -  old_msg= thd->enter_cond(&update_cond,&LOCK_log,
>> -                           "Master has sent all binlog to slave; "
>> -                           "waiting for binlog to be updated");
>> +  thd->enter_cond(&update_cond,&LOCK_log,
>> +                  "Master has sent all binlog to slave; "
>> +                  "waiting for binlog to be updated");
>>     if (!timeout)
>>       mysql_cond_wait(&update_cond,&LOCK_log);
>>     else
>>
>> === modified file 'sql/sql_repl.cc'
>> --- a/sql/sql_repl.cc    2010-07-26 10:52:59 +0000
>> +++ b/sql/sql_repl.cc    2010-08-04 22:28:28 +0000
>> @@ -826,6 +826,7 @@ impossible position";
>>   #ifndef DBUG_OFF
>>             ulong hb_info_counter= 0;
>>   #endif
>> +          const char* old_msg= thd->proc_info;
>>             signal_cnt= mysql_bin_log.signal_cnt;
>>             do
>>             {
>> @@ -849,12 +850,15 @@ impossible position";
>>   #endif
>>                 /* reset transmit packet for the heartbeat event */
>>                 if (reset_transmit_packet(thd, 
>> flags,&ev_offset,&errmsg))
>> +              {
>> +                thd->exit_cond(old_msg);
>>                   goto err;
>> +              }
>>                 if (send_heartbeat_event(net, packet, coord))
>>                 {
>>                   errmsg = "Failed on my_net_write()";
>>                   my_errno= ER_UNKNOWN_ERROR;
>> -                mysql_mutex_unlock(log_lock);
>> +                thd->exit_cond(old_msg);
>>                   goto err;
>>                 }
>>               }
>> @@ -863,7 +867,7 @@ impossible position";
>>                 DBUG_PRINT("wait",("binary log received update or a 
>> broadcast signal caught"));
>>               }
>>             } while (signal_cnt == mysql_bin_log.signal_cnt&&  
>> !thd->killed);
>> -          mysql_mutex_unlock(log_lock);
>> +          thd->exit_cond(old_msg);
>>           }
>>           break;
>>
>>
>>
>>
>>
>>
>
>

Thread
bzr commit into mysql-5.5-bugfixing branch (alfranio.correia:3203) Bug#55415Alfranio Correia3 Sep
  • Re: bzr commit into mysql-5.5-bugfixing branch (alfranio.correia:3203)Bug#55415Luís Soares6 Sep
    • Re: bzr commit into mysql-5.5-bugfixing branch (alfranio.correia:3203)Bug#55415Alfranio Correia6 Sep