List:Commits« Previous MessageNext Message »
From:Libing Song Date:January 29 2010 6:36am
Subject:Re: bzr commit into mysql-5.1-rep-semisync branch (Li-Bing.Song:3127)
Bug#50157
View as plain text  
Hi Zhenxing,
Thanks for your review.
The new patch has been committed, please review again.

On Thu, 2010-01-28 at 12:07 +0800, He Zhenxing wrote:
> > +
> > +  TranxNode *allocate_node()
> > +  {
> > +    TranxNode *trx_node;
> > +    Block *block= current_block;
> > +
> > +    if (last_node == BLOCK_TRANX_NODES-1)
> > +    {
> > +      current_block= current_block->next;
> > +      last_node= -1;
> > +    }
> > +
> > +    if (current_block == NULL && allocate_block())
> > +    {
> > +      current_block= block;
> > +      if (current_block)
> > +        last_node= BLOCK_TRANX_NODES-1;
> > +      return NULL;
> > +    }
> > +
> 
> I'd suggest:
> 
> if (last_node == BLOCK_TRANX_NODES-1)
> {
>    if (current_block->next != NULL)
>       current_block = current_block->next;
>    else if (allocate_block())
>       return NULL;
>    last_node = -1;
> }
  'if (current_block == NULL && allocate_block())'
  is still needed, for current_block is null when starting up.




-- 
Your Sincerely,
Libing Song
==================================
MySQL Replication Team
Software Engineer
Certified (ISC)2 CISSP

Email : Li-Bing.Song@stripped
Skype : libing.song
MSN   : slb_database@stripped
Phone : +86 010-6505-4020 ext. 319
Mobile: +86 138-1144-2038
==================================


Thread
bzr commit into mysql-5.1-rep-semisync branch (Li-Bing.Song:3127) Bug#50157Li-Bing.Song27 Jan
  • Re: bzr commit into mysql-5.1-rep-semisync branch (Li-Bing.Song:3127)Bug#50157He Zhenxing28 Jan
    • Re: bzr commit into mysql-5.1-rep-semisync branch (Li-Bing.Song:3127)Bug#50157Libing Song29 Jan
      • Re: bzr commit into mysql-5.1-rep-semisync branch (Li-Bing.Song:3127)Bug#50157He Zhenxing29 Jan
  • Re: bzr commit into mysql-5.1-rep-semisync branch (Li-Bing.Song:3127)Bug#50157Luís Soares28 Jan
    • Re: bzr commit into mysql-5.1-rep-semisync branch (Li-Bing.Song:3127)Bug#50157Libing Song29 Jan
      • Re: bzr commit into mysql-5.1-rep-semisync branch (Li-Bing.Song:3127)Bug#50157Luís Soares29 Jan