Bug #39350 Falcon: Releasing deferred indexes causes crash
Submitted: 9 Sep 2008 23:45 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: D1 (Critical)

[9 Sep 2008 23:45] Christopher Powers
Description:
Concurrent releases of a deferred index will cause a crash.

The attached stack trace shows a race condition between a gopher thread and drop table,
where both threads release the deferred indexes for the same table. In this case, the drop
table won.

How to repeat:
System QA stress test "falcon_online_alter"

Suggested fix:
Increment the DefereredIndex use count when it is attached to a transaction.

In the example provided, two transactions were releasing the same deferred index, however,
the use count had not be incremented when the deferred index was attached to either
transaction.
[9 Sep 2008 23:46] Christopher Powers
Stack trace resulting from 'falcon_online_alter'

Attachment: distack3.txt (text/plain), 6.28 KiB.

[10 Sep 2008 6:05] 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/53652

2815 Christopher Powers	2008-09-09
      Bug#39350 Falcon: Releasing deferred indexes causes crash
      
      - Transactions now bump the reference count for deferred indexes
      - Transaction::releaseDeferredIndexes(Table *) now gets exclusive lock on
syncDeferredIndexes
[10 Sep 2008 6:06] 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/53653

2815 Christopher Powers	2008-09-09
      Bug#39350 Falcon: Releasing deferred indexes causes crash
      
      - Transactions now bump the reference count for deferred indexes
      - Transaction::releaseDeferredIndexes(Table *) now gets exclusive lock on
syncDeferredIndexes
[10 Sep 2008 6:08] 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/53654

2815 Christopher Powers	2008-09-09
      Bug#39350 Falcon: Releasing deferred indexes causes crash
      
      - Transactions now bump the reference count for deferred indexes
      - Transaction::releaseDeferredIndexes(Table *) now gets exclusive lock on
syncDeferredIndexes
[10 Sep 2008 6:40] 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/53655

2816 Christopher Powers	2008-09-09
      Bug#39350 Falcon: Releasing deferred indexes causes crash
      
      Minor changes per code review
[10 Sep 2008 6:40] 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/53656

2816 Christopher Powers	2008-09-09
      Bug#39350 Falcon: Releasing deferred indexes causes crash
      
      Minor changes per code review
[10 Sep 2008 6:41] 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/53657

2816 Christopher Powers	2008-09-09
      Bug#39350 Falcon: Releasing deferred indexes causes crash
      
      Minor changes per code review
[10 Sep 2008 6:42] 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/53658

2816 Christopher Powers	2008-09-09
      Bug#39350 Falcon: Releasing deferred indexes causes crash
      
      Minor changes per code review
[10 Sep 2008 8:45] 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/53659

2817 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
      
      Removed new DeferredIndex reference counts in Transaction and DeferredIndexWalker.
[10 Sep 2008 8:46] 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/53660

2817 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
      
      Removed new DeferredIndex reference counts in Transaction and DeferredIndexWalker.
[10 Sep 2008 9:08] 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/53662

2817 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
      
      Removed new DeferredIndex reference counts in Transaction and DeferredIndexWalker.
[10 Sep 2008 9:53] 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/53664

2817 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
      
      Removed new DeferredIndex reference counts in Transaction and DeferredIndexWalker.
[10 Sep 2008 13:40] 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/53679

2818 lars-erik.bjork@sun.com	2008-09-10
      Added assert to ensure that NULL is not secretly inserted
[10 Sep 2008 19:35] 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/53718

2820 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
        
      Fixed regression to last commit that prevented deferred indexes from being released.
[10 Sep 2008 19:38] 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/53721

2820 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
        
      Fixed regression to last commit that prevented deferred indexes from being released.
[10 Sep 2008 19:42] 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/53723

2820 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
        
      Fixed regression to last commit that prevented deferred indexes from being released.
[10 Sep 2008 19:46] 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/53724

2820 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
        
      Fixed regression to last commit that prevented deferred indexes from being released.
[10 Sep 2008 21:53] 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/53734

2821 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
          
      Restored DeferredIndex addRef/releaseRef to Transaction.
[10 Sep 2008 21:56] 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/53735

2821 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
          
      Restored DeferredIndex addRef/releaseRef to Transaction.
[10 Sep 2008 22:10] 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/53738

2821 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
          
      Restored DeferredIndex addRef/releaseRef to Transaction.
[10 Sep 2008 22:11] 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/53739

2821 Christopher Powers	2008-09-10
      Bug #39350 Falcon: Releasing deferred indexes causes crash
          
      Restored DeferredIndex addRef/releaseRef to Transaction.
[6 Nov 2008 6:40] Kevin Lewis
See Bug#39711 for the final patch to resolve DeferredIndex referencing.
[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