← Back to team overview

maria-developers team mailing list archive

Re: Rev 3967: MDEV-5597 - Reduce usage of LOCK_open: LOCK_flush

 

Hi, Sergey!

On Jan 31, Sergey Vojtovich wrote:
> > 
> > I'm sorry, I don't understand that at all.
> > 
> > Why my_refs is only incremented in debug builds? In non-debug builds you
> > wait until all tables but one are closed, in debug builds you may keep
> > more than one table opened.
> See above, this patch removes #ifndef DBUG_OFF, so my_refs are counted properly
> in both builds.

Right. Sorry. My mistake.

> > You wait here on a condition, how do you know there's FLUSH TABLES (or
> > anything at all) running that will signal this condition?
> 1. we're protected by exclusive metadata lock, so the only possible statement
>    that may cause concurrency issues should be FLUSH TABLES (in fact there are
>    more cases, like ha_table_exists()).
> 2. share->tdc.all_tables holds only tables owned by current thread (or empty),
>    there are assertions for this above.
> 3. if concurrent FLUSH TABLES removed some TABLE instances from tdc.all_tables,
>    but didn't close them yet, share ref_count reflects that.
> 4. this FLUSH TABLES must call intern_close_table(), which will eventually call
>    tdc_release_share()/mysql_cond_broadcast().
> 
> That's it.

Okay, thanks. Got it.
What did you mean "like ha_table_exists()" ?

Regards,
Sergei


Follow ups

References