List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:December 28 2011 10:09am
Subject:Re: question about locks with optimize table
View as plain text  
Hi!

>>>>> "Zardosht" == Zardosht Kasheff <zardosht@stripped> writes:

Zardosht> How can a storage engine allow access to a table by other clients while an
Zardosht> optimize is running?

Zardosht> I think the issue here is that even if the storage
Zardosht> engine could theoretically allow access to the table by other clients while
Zardosht> running an optimize, there is no way for the storage engine to tell MySQL
Zardosht> that this is ok. Setting the lock type to TL_WRITE_ALLOW_WRITE in
Zardosht> handler::store_lock does not work


By doing it either of these ways:

- Return at once from handler::optimize() and then run optimize in the
  background in the storage engine.

- Change mysql_admin_table() to check for 'table->lock_type' instead
  of 'lock_type' in the code.  This should allow the storage engine to
  change to use TL_WRITE_ALLOW_WRITE in handler::store_lock().

Please check if the later works for you, in which case I will do the
above change in MariaDB.

Regards,
Monty
Thread
question about locks with optimize tableJohn Esmet15 Dec
  • Re: question about locks with optimize tableJohn Esmet19 Dec
  • re: question about locks with optimize tableMichael Widenius27 Dec
Re: question about locks with optimize tableZardosht Kasheff28 Dec
Re: question about locks with optimize tableMichael Widenius28 Dec
  • Re: question about locks with optimize tableZardosht Kasheff28 Dec
    • Re: question about locks with optimize tableMichael Widenius29 Dec