From: MARK CALLAGHAN Date: July 3 2009 3:01pm Subject: Re: How to recover from online DDL failure? List-Archive: http://lists.mysql.com/internals/37080 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Jul 2, 2009 at 7:04 PM, Yuan Wang wrote: > In MySQL 5.1, online DDL operations such as adding/dropping index is > allowed. If the server crashes during online DDL operations, it seems > that the table definition of MySQL and that in the underlining storage > engine will be inconsistent. For example, if the server crashes in > handler::add_index when all the storage engine stuff has been done but > before returing to MySQL. So after restart, the storage engine will > think that the new index is ready, however, the MySQL server will > think that the new index is not ready. > > So this seems to be a serious problem? Crash recovery for DDL is a known bug. It doesn't require online DDL to reproduce. Any DDL operation that requires the creation or removal of of an FRM file has always done that non-atomically with changes to the storage engine. A crash between the two steps (create/remove FRM file, perform change on storage engine) can leave the system in a bad state at startup (existence of FRM file does not match existence of table in the storage engine). See http://bugs.mysql.com/bug.php?id=25922 I think that Drizzle has a (Drizzle only) fix for this in progress. -- Mark Callaghan mdcallag@stripped