From: Date: October 4 2008 2:10am Subject: bzr commit into mysql-6.0-falcon-team branch (cpowers:2853) Bug#39846 List-Archive: http://lists.mysql.com/commits/55299 X-Bug: 39846 Message-Id: <20081004001047.CB41B1DB0669@xeno.mysql.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/cpowers/work/dev/dev-08/mysql/ 2853 Christopher Powers 2008-10-03 Bug#39846, "Falcon: Concurrent online alter causes assertion in SRLUpdateIndex::append()" modified: storage/falcon/DeferredIndex.cpp storage/falcon/SRLUpdateIndex.cpp per-file messages: storage/falcon/DeferredIndex.cpp Changed shared lock to exclusive lock in DeferredIndex::detachIndex(). Attributes should never be nulled out if another thread may be using it. storage/falcon/SRLUpdateIndex.cpp SRLUpdateIndex::append() -- Get shared lock on DeferredIndex === modified file 'storage/falcon/DeferredIndex.cpp' --- a/storage/falcon/DeferredIndex.cpp 2008-10-02 23:20:47 +0000 +++ b/storage/falcon/DeferredIndex.cpp 2008-10-04 00:10:34 +0000 @@ -819,7 +819,7 @@ void DeferredIndex::scanIndex(IndexKey * void DeferredIndex::detachIndex(void) { Sync sync(&syncObject, "DeferredIndex::detachIndex"); - sync.lock(Shared); + sync.lock(Exclusive); // was Shared index = NULL; } === modified file 'storage/falcon/SRLUpdateIndex.cpp' --- a/storage/falcon/SRLUpdateIndex.cpp 2008-07-15 18:57:27 +0000 +++ b/storage/falcon/SRLUpdateIndex.cpp 2008-10-04 00:10:34 +0000 @@ -40,14 +40,29 @@ SRLUpdateIndex::~SRLUpdateIndex(void) void SRLUpdateIndex::append(DeferredIndex* deferredIndex) { + uint indexId; + int idxVersion; + int tableSpaceId; + + Sync syncDI(&deferredIndex->syncObject, "SRLUpdateIndex::append"); + syncDI.lock(Shared); + + if (!deferredIndex->index) + return; + else + { + indexId = deferredIndex->index->indexId; + idxVersion = deferredIndex->index->indexVersion; + tableSpaceId = deferredIndex->index->dbb->tableSpaceId; + } + + syncDI.unlock(); + Sync syncIndexes(&log->syncIndexes, "SRLUpdateIndex::append(1)"); syncIndexes.lock(Shared); Transaction *transaction = deferredIndex->transaction; DeferredIndexWalker walker(deferredIndex, NULL); - uint indexId = deferredIndex->index->indexId; - int idxVersion = deferredIndex->index->indexVersion; - int tableSpaceId = deferredIndex->index->dbb->tableSpaceId; uint64 virtualOffset = 0; uint64 virtualOffsetAtEnd = 0;