List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:June 22 2010 12:13pm
Subject:re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?
View as plain text  
Hi!

>>>>> "Konstantin" == Konstantin Osipov <kostja@stripped> writes:

Konstantin> Hello,
Konstantin> I'm personally convinced that FLUSH TABLES, FLUSH TABLES <list>,
Konstantin> FLUSH TABLES WITH READ LOCK should wait for all started *write*
Konstantin> (only write) transactions against the involved tables to complete.

To answer this one, we should consider what FLUSH TABLES is used for.

It's main (only?) purposes are

- To allow easy file system level backups of the databases
- To prepare a database for a snapshot
- (Optional) Flush things to disk, so that a restart is faster.

In no case above do we need to wait for *write* transactions to
finish.  This is especially true when doing system level snapshots.

The gut feeling is thus that we should not wait for transactions to
finish for the above commands.

About the mutex; We only take a mutex (at least in 5.1) if there is a
global read lock active, in which case it doesn't really matter if we
take one or two mutex.  In normal operations there is no mutex, so
this is no argument for changing the behavior for FLUSH TABLES.

Regards,
Monty

Have you already tried MariaDB?  http://askmonty.org/wiki/MariaDB
Thread
Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Konstantin Osipov21 Jun
  • re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Michael Widenius22 Jun
    • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Konstantin Osipov23 Jun
      • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Michael Widenius24 Jun
    • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Baron Schwartz24 Jun
      • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Konstantin Osipov24 Jun
        • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Baron Schwartz24 Jun
        • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Rob Wultsch24 Jun
          • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Konstantin Osipov24 Jun
            • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?Rob Wultsch24 Jun
  • Re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions?MARK CALLAGHAN23 Jun