From: Michael Widenius Date: June 22 2010 12:13pm Subject: re: Should FLUSH TABLES WITH READ LOCK wait for updating transactions? List-Archive: http://lists.mysql.com/internals/37968 Message-Id: <19488.43265.175281.922259@narttu.askmonty.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! >>>>> "Konstantin" == Konstantin Osipov writes: Konstantin> Hello, Konstantin> I'm personally convinced that FLUSH TABLES, FLUSH TABLES , 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