List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:April 17 2007 4:45pm
Subject:bk commit into 5.1-falcon tree (jas:1.2605)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1-falcon repository of . When  does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-04-17 10:45:07-04:00, jas@rowvwade. +1 -0
  Use Transaction::syncIndex to resolve a race condition
  between dropTable and writeComplete.

  storage/falcon/Transaction.cpp@stripped, 2007-04-17 10:45:01-04:00, jas@rowvwade. +8 -6
    Use Transaction::syncIndex to resolve a race condition
    between dropTable and writeComplete.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jas
# Host:	rowvwade.
# Root:	D:/MySQL/mysql-5.1-falcon

--- 1.76/storage/falcon/Transaction.cpp	2007-04-17 10:45:26 -04:00
+++ 1.77/storage/falcon/Transaction.cpp	2007-04-17 10:45:26 -04:00
@@ -609,10 +609,11 @@
 
 void Transaction::dropTable(Table* table)
 {
+	Sync sync(&syncIndexes, "Transaction::dropTable");
+	sync.lock(Exclusive);
+
 	if (deferredIndexes)
 		{
-		Sync sync(&syncIndexes, "Transaction::dropTable");
-		sync.lock(Exclusive);
 		
 		for (DeferredIndex **ptr = &deferredIndexes, *deferredIndex; (deferredIndex =
*ptr);)
 			if (deferredIndex->index->table == table)
@@ -623,9 +624,9 @@
 				}
 			else
 				ptr = &deferredIndex->next;
-		
-		sync.unlock();
 		}
+	
+	// Keep exclusive lock to avoid race condition with writeComplete
 		
 	for (RecordVersion **ptr = &records, *rec; (rec = *ptr);)
 		if (rec->table == table)
@@ -661,11 +662,12 @@
 		deferredIndexCount--;
 		}
 
-	sync.unlock();
-
+	// Keep the synIndexes lock to avoid a race condition with dropTable
+	
 	if (dependencies == 0)
 		commitRecords();
 
+	sync.unlock();
 	writePending = false;
 }
 
Thread
bk commit into 5.1-falcon tree (jas:1.2605)U-ROWVWADEjas17 Apr