List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:November 7 2007 11:22pm
Subject:RE: bk commit into 5.2 tree (cbell:1.2610) BUG#31383
View as plain text  
Hi Rafal,

I have a solution now that meets (I think) the protocol you are describing.
I have also reworked the threading code so that the destructor for the
driver is held until the locking thread is done.

The new patch is: http://lists.mysql.com/commits/37297

It runs on Windows and Linux now.

All other things you addressed in the last review have been changed except
for:

> > +  /*
> > +    Part of work is done. Rest until woken up.
> > +  */
> > +  pthread_mutex_lock(&THR_LOCK_driver_thread);
> > +  thd->enter_cond(&COND_driver_thread_wait,
> &THR_LOCK_driver_thread,
> > +                  "Online backup driver thread: holding table locks");
> > +  while (!thd->killed)
> > +    pthread_cond_wait(&COND_driver_thread_wait,
&THR_LOCK_driver_thread);
> > +  thd->exit_cond("Online backup driver thread: terminating");
> > +
> > +  DBUG_PRINT("info",("Online backup driver thread locking thread
terminating"));
> > +
> > +end:
> > +  /*
> > +    Cleanup and return.
> > +  */
> > +  close_thread_tables(thd);
> 
> Shouldn't we close the tables only if they were opened successfuly?
> 

This was taken from other parts of the code and the call is made even if the
tables were opened correctly. The original if(open_and_lock... code from
which this was taken is written that way in many places in the server.
Besides, it doesn't hurt to call it if no tables were opened. It just falls
through, but I see some cleanup things in the method so I think it's a safe
call.

Chuck 

> -----Original Message-----
> From: Rafal Somla [mailto:rsomla@stripped] 
> Sent: Wednesday, November 07, 2007 9:42 AM
> To: Chuck Bell
> Cc: commits@stripped; 'Lars Thalmann'
> Subject: Re: bk commit into 5.2 tree (cbell:1.2610) BUG#31383
> 
> Sequence of calls for the default driver:
> 
> drv->begin()
> drv->get_data()  // return READY to indicate that init phase 
> is finished
> 
> drv->get_data()  // following calls return no data and OK
> 
> drv->prepare()   // returns OK
> 
> drv->get_data()  // return OK until locks are obtained
> 
> drv->get_data()  // reurns READY when locks are obtained
> 
> drv->get_data()  // all following get_data() return OK except 
> the last 
> drv->one which
>                      should return DONE
> 
> Hope that will make it work.
> 
> R.
> 
> 
> --
> MySQL Code Commits Mailing List
> For list archives: http://lists.mysql.com/commits
> To unsubscribe:    
> http://lists.mysql.com/commits?unsub=1
> 

Thread
bk commit into 5.2 tree (cbell:1.2610) BUG#31383cbell5 Nov
  • Re: bk commit into 5.2 tree (cbell:1.2610) BUG#31383Rafal Somla6 Nov
    • RE: bk commit into 5.2 tree (cbell:1.2610) BUG#31383Chuck Bell6 Nov
      • Re: bk commit into 5.2 tree (cbell:1.2610) BUG#31383Rafal Somla7 Nov
        • RE: bk commit into 5.2 tree (cbell:1.2610) BUG#31383Chuck Bell7 Nov
          • Re: bk commit into 5.2 tree (cbell:1.2610) BUG#31383Rafal Somla7 Nov
            • RE: bk commit into 5.2 tree (cbell:1.2610) BUG#31383Chuck Bell7 Nov