From: Date: July 7 2008 8:27am Subject: bzr commit into mysql-6.0-falcon branch (klewis:2733) Bug#37587 List-Archive: http://lists.mysql.com/commits/49061 X-Bug: 37587 Message-Id: <200807070627.m676QuVc023398@mail.mysql.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///C:/Work/bzr/Merge/mysql-6.0-falcon/ 2733 Kevin Lewis 2008-07-07 Bug#37587 - Fix this 3 way deadlock a different way. Allow the gopher to hold SerialLog::pending.syncObject while it locks serializeGophers, but release serializeGophers before getting SerialLog::pending.syncObject back. Then fix TableSpaceManager::dropTableSpace so that it releases its syncObject before calling dropTableSpace.append(). modified: storage/falcon/Gopher.cpp storage/falcon/TableSpaceManager.cpp per-file messages: storage/falcon/Gopher.cpp Bug#37587 - Fix this 3 way deadlock a different way. Allow the gopher to hold SerialLog::pending.syncObject while it locks serializeGophers, but release serializeGophers before getting SerialLog::pending.syncObject back. Then fix TableSpaceManager::dropTableSpace so that it releases its syncObject before calling dropTableSpace.append(). storage/falcon/TableSpaceManager.cpp Bug#37587 - Fix this 3 way deadlock a different way. Fix TableSpaceManager::dropTableSpace so that it releases its syncObject before calling dropTableSpace.append(). === modified file 'storage/falcon/Gopher.cpp' --- a/storage/falcon/Gopher.cpp 2008-06-30 16:51:55 +0000 +++ b/storage/falcon/Gopher.cpp 2008-07-07 06:26:23 +0000 @@ -43,8 +43,8 @@ void Gopher::gopherThread(void) deadMan.lock(Shared); workerThread = Thread::getThread("Gopher::gopherThread"); active = true; - Sync sync (&log->pending.syncObject, "Gopher::gopherThread pending"); - sync.lock(Exclusive); + Sync syncPending (&log->pending.syncObject, "Gopher::gopherThread pending"); + syncPending.lock(Exclusive); while (!workerThread->shutdownInProgress && !log->finishing) { @@ -53,18 +53,17 @@ void Gopher::gopherThread(void) if (log->blocking) log->unblockUpdates(); - sync.unlock(); + syncPending.unlock(); active = false; workerThread->sleep(); active = true; - sync.lock(Exclusive); + syncPending.lock(Exclusive); continue; } SerialLogTransaction *transaction = log->pending.first; log->pending.remove(transaction); - sync.unlock(); Sync serializeGophers(&log->syncSerializeGophers, "Gopher::gopherThread(4)"); if (transaction->allowConcurrentGophers) @@ -72,10 +71,12 @@ void Gopher::gopherThread(void) else serializeGophers.lock(Exclusive); + syncPending.unlock(); + transaction->doAction(); - sync.lock(Exclusive); serializeGophers.unlock(); + syncPending.lock(Exclusive); log->inactions.append(transaction); === modified file 'storage/falcon/TableSpaceManager.cpp' --- a/storage/falcon/TableSpaceManager.cpp 2008-06-17 17:41:54 +0000 +++ b/storage/falcon/TableSpaceManager.cpp 2008-07-07 06:26:23 +0000 @@ -326,8 +326,6 @@ void TableSpaceManager::dropTableSpace(T statement->executeUpdate(); Transaction *transaction = database->getSystemTransaction(); transaction->hasUpdates = true; - pendingDrops++; - database->serialLog->logControl->dropTableSpace.append(tableSpace, transaction); syncDDL.unlock(); database->commitSystemTransaction(); @@ -342,7 +340,11 @@ void TableSpaceManager::dropTableSpace(T break; } + pendingDrops++; syncObj.unlock(); + + database->serialLog->logControl->dropTableSpace.append(tableSpace, transaction); + tableSpace->active = false; }