Bug #39349 Falcon: Online drop index conflicts with other index operations
Submitted: 9 Sep 2008 23:36 Modified: 9 Jan 15:10
Reporter: Christopher Powers
Status: Closed
Category:Server: Falcon Severity:S1 (Critical)
Version:6.0-falcon OS:Any
Assigned to: Christopher Powers Target Version:6.0.8
Triage: Triaged: D2 (Serious)

[9 Sep 2008 23: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.
[10 Sep 2008 1:02] Christopher Powers
Verified while debugging stress test failures.
[10 Sep 2008 1: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
[10 Sep 2008 1: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
[10 Sep 2008 1: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 15: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