Bug #39349 Falcon: Online drop index conflicts with other index operations
Submitted: 9 Sep 2008 21:36 Modified: 9 Jan 2009 14:10
Reporter: Christopher Powers Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S1 (Critical)
Version:6.0-falcon OS:Any
Assigned to: Christopher Powers CPU Architecture:Any
Triage: Triaged: D2 (Serious)

[9 Sep 2008 21:36] Christopher Powers
Description:
Online drop index may conflict with other index operations such as including index scans.

The StorageInterface maintains a mapping between the table indexes in the MySQL server and the corresponding Falcon indexes. This mapping is maintained within an array of StorageIndexDesc objects.

When one client drops an index, another client may initiate a concurrent index operation that accesses the mapping object of the index being dropped, causing a crash.

How to repeat:
System QA stress test "falcon_online_alter".

Suggested fix:
The problem was that StorageInterface::setIndex() instantiates StorageIndexDesc objects for indexes that no longer exist within Falcon.

Solution: Do not instantiate a mapping object if the internal Falcon index cannot be found. Concurrent client operations that access that index will fail and return StorageErrorIndexNotFound.
[9 Sep 2008 23:02] Christopher Powers
Verified while debugging stress test failures.
[9 Sep 2008 23:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53647

2814 Christopher Powers	2008-09-09
      Bug#39347 Falcon: Online add/drop unique index fails
      Bug#39349 Falcon: Online drop index conflicts with other index operations
      Bug#39354 Falcon: Rename table corrupts index mapping
      
      - Enabled HA_ADD/DROP_UNIQUE_INDEX
      - Don't create StorageIndexDesc objects if internal falcon index does not exist
      - Rebuild index mapping when table is renamed
      - Added validation methods to detect out-of-sync condition between server and falcon indexes
[9 Sep 2008 23:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53648

2814 Christopher Powers	2008-09-09
      Bug#39347 Falcon: Online add/drop unique index fails
      Bug#39349 Falcon: Online drop index conflicts with other index operations
      Bug#39354 Falcon: Rename table corrupts index mapping
      
      - Enabled HA_ADD/DROP_UNIQUE_INDEX
      - Don't create StorageIndexDesc objects if internal falcon index does not exist
      - Rebuild index mapping when table is renamed
      - Added validation methods to detect out-of-sync condition between server and falcon indexes
[9 Sep 2008 23:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53649

2814 Christopher Powers	2008-09-09
      Bug#39347 Falcon: Online add/drop unique index fails
      Bug#39349 Falcon: Online drop index conflicts with other index operations
      Bug#39354 Falcon: Rename table corrupts index mapping
      
      - Enabled HA_ADD/DROP_UNIQUE_INDEX
      - Don't create StorageIndexDesc objects if internal falcon index does not exist
      - Rebuild index mapping when table is renamed
      - Added validation methods to detect out-of-sync condition between server and falcon indexes
[9 Jan 2009 14:10] MC Brown
A note has been added to the 6.0.8 changelog: 

When performing an online DROP INDEX on a Falcon table, the operation may conflict with other index operations such as including index scans. When one client drops an index, another client may initiate a concurrent index operation that accesses the mapping object of the index being dropped, and this can cause a crash