From: Zardosht Kasheff Date: December 28 2011 12:00am Subject: Re: question about locks with optimize table List-Archive: http://lists.mysql.com/internals/38411 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry for resending, but I don't think the first email made it to the internals list. On Tue, Dec 27, 2011 at 6:57 PM, Zardosht Kasheff wrot= e: > > How can a storage engine allow access to a table by other clients while a= n optimize is running? I think the issue here is that even if the storage e= ngine could theoretically allow access to the table by other clients while = running an optimize, there is no way for the storage engine to tell MySQL t= hat this is ok. Setting the lock type to TL_WRITE_ALLOW_WRITE in handler::s= tore_lock does not work > > > On Tue, Dec 27, 2011 at 6:47 PM, Michael Widenius wr= ote: >> >> >> Hi! >> >> >>>>> "John" =3D=3D John Esmet writes: >> >> John> Hi Guys, >> John> I'm looking to modify mysql to allow a storage engine to run optim= ize >> John> table and have other cilents be able to select/insert/etc. where i= s a >> John> good place to start looking for modifications? I noticed sql_table= .cc >> John> calls mysql_admin_table for optimize statements, which i assume do= es >> John> the table locking. >> >> Is this for existing or a new storage engine ? >> >> For a new storage engine, this should be done totally inside the >> engine and thus should only affect storage engine code. >> >> For existing engines, this is not that trivial as optimize table works >> by copying data to another table and then swapping files. This can't >> easily be done as long as other insert/selects are running. >> >> Regards, >> Monty >> Founder of MySQL and MariaDB >> >> -- >> MySQL Internals Mailing List >> For list archives: http://lists.mysql.com/internals >> To unsubscribe: =A0 =A0http://lists.mysql.com/internals >> >