From: Rafal Somla Date: February 6 2009 10:23am Subject: Re: Bug still exists Re: bzr commit into mysql-6.0-backup branch (ingo.struewing:2737) Bug#40944 List-Archive: http://lists.mysql.com/commits/65458 Message-Id: <498C0F89.2010806@sun.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=UTF-8 Content-Transfer-Encoding: 8BIT Ingo Strüwing wrote: > > It may be good to have their opinion to my view: > > The RESTORE locking scheme has been developed before Dmitri's Meta Data > Locks (MDL) existed. There seems to be common agreement that we should > refactor it so that it takes exclusive MDL for all tables to be > restored. Before even creating the tables, I think. Once this is done, > the SELECT would be blocked even before attempting to open the table. So > it wouldn't mark it "in_use". The lock would persist until RESTORE > finishes. That is, until after close_cached_tables(). > I double Ingo's opinion: we should try to take MDL locks inside RESTORE before creating the tables and release them only after all is done. This seems to me to be the most clean solution. Rafal