Bug #55528 InnoDB plugin tables cannot be queried during add index, regression from InnoDB
Submitted: 24 Jul 2010 1:24 Modified: 26 Jul 2010 7:02
Reporter: Zardosht Kasheff (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S3 (Non-critical)
Version:5.1.48 OS:Any
Assigned to: CPU Architecture:Any
Tags: add index, Contribution

[24 Jul 2010 1:24] Zardosht Kasheff
Description:
On a table using the InnoDB plugin, start the creation of an index. In another thread, try to simultaneously query the table.  The query hangs until the index creation is complete.

This does not happen with the statically linked InnoDB. With the statically linked InnoDB, this does not happen. If one thread is creating an index, other threads can still query the table.

This is a duplicate of #42230. When I originally filed that bug, the InnoDB plugin did not ship with MySQL 5.1. Now it does, hence making this behavior a regression. I am opening the bug with this title to draw attention to the fact that this problem is now visible to the user with MySQL 5.1.

How to repeat:
On a table foo with column 'a' that uses the innodb plugin, do the following. In one thread run "alter table foo add index (a)". In another thread, run "select * from foo limit 1;" The select will hang until the index creation is complete. With the statically linked InnoDB, the query successfully executes.

Suggested fix:
I will contribute a patch shortly, based on the comment by Sergey Vojtovich in bug #42230.
[24 Jul 2010 1:30] Zardosht Kasheff
patch based off of 5.1.46 that seems to solve issue

Attachment: 55528.diff (application/octet-stream, text), 1.14 KiB.

[24 Jul 2010 15:38] Zardosht Kasheff
patch as suggested by Davi Arnaut on internals alias

Attachment: 55528-version2.diff (application/octet-stream, text), 484 bytes.

[24 Jul 2010 15:40] Zardosht Kasheff
I just added 55528-version2.diff, based off of discussion on internals alias. Please disregard 55528.diff and consider this patch. The relevant discussion on the internals alias is http://lists.mysql.com/internals/37995
[26 Jul 2010 7:02] Sveta Smirnova
Thank you for the report.

Technically this is duplicate of bug #42230. I'll request re-triage of that bug.