Comments on: State of InnDB Online DDL in MySQL 5.6.8-RC https://shlomi-noach.github.io/blog/mysql/state-of-inndb-online-ddl-in-mysql-5-6-8-rc Blog by Shlomi Noach Wed, 28 Nov 2012 21:49:48 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: James Day https://shlomi-noach.github.io/blog/mysql/state-of-inndb-online-ddl-in-mysql-5-6-8-rc/comment-page-1#comment-140967 Wed, 28 Nov 2012 21:49:48 +0000 https://shlomi-noach.github.io/blog/?p=5823#comment-140967 It’s still an active work in progress at the moment but there are some improvements to the documentation for this that may help. See http://dev.mysql.com/doc/refman/5.6/en/innodb-online-ddl.html .

The inconsistency you saw is probably explained in this paragraph: “An online DDL statement for an InnoDB table always waits for currently executing transactions that are accessing the table to commit or roll back, because it requires exclusive access to the table for a brief period while the DDL statement is being prepared. Likewise, it requires exclusive access to the table for a brief time before finishing. Thus, an online DDL statement waits for any transactions that are started while the DDL is in progress, and query or modify the table, to commit or roll back before the DDL completes.”

So an open SELECT can prevent the commit (final) phase from getting its lock until the SELECT has finished, delaying the ALTER in a time when it’s locking exclusively. We’re looking into improving this since it’s not really desirable to hold an exclusive lock while waiting for a SELECT to finish, no guarantee that this will happen, nor when.

Best to check the documentation from time to time as it improves and use bug reports for feedback and requests for clarifications of things, that feedback is at least as welcome as blog posts. This applies to all new (and existing) feature descriptions. Lots of ongoing work on their documentation.

Please do keep up the feedback, it’s much appreciated!

Views are my own, for an official view, seek a PR person.

James Day, MySQL Senior Principal Support Engineer, Oracle

]]>