List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:February 3 2008 6:49pm
Subject:bk commit into 6.0 tree (jas:1.2792)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 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, 2008-02-03 13:49:30-05:00, jas@rowvwade. +2 -0
  Fixed "releaseDependency" bug (33759).
  
  The problem was failure to lock out new transaction dependencies
  while trying to drop existing dependencies.

  storage/falcon/Transaction.cpp@stripped, 2008-02-03 13:49:21-05:00, jas@rowvwade. +13 -49
    Fixed "releaseDependency" bug (33759).
    
    The problem was failure to lock out new transaction dependencies
    while trying to drop existing dependencies.

  storage/falcon/TransactionManager.cpp@stripped, 2008-02-03 13:49:21-05:00, jas@rowvwade. +0 -1
    Eliminate dead line of code.

diff -Nrup a/storage/falcon/Transaction.cpp b/storage/falcon/Transaction.cpp
--- a/storage/falcon/Transaction.cpp	2008-01-30 01:57:53 -05:00
+++ b/storage/falcon/Transaction.cpp	2008-02-03 13:49:21 -05:00
@@ -167,14 +167,13 @@ void Transaction::initialize(Connection*
 				{
 				Sync syncDependency(&transaction->syncObject, "Transaction::initialize");
 				syncDependency.lock(Shared);
-				transaction->addRef();
-				INTERLOCKED_INCREMENT(transaction->dependencies);
 
 				if (transaction->isActive() && 
 					 !transaction->systemTransaction &&
 					 transaction->transactionId < transactionId)
 					{
-					//transaction->cleanupNeeded = 1;
+					transaction->addRef();
+					INTERLOCKED_INCREMENT(transaction->dependencies);
 					TransState *state = states + numberStates;
 					state->transaction = transaction;
 					state->transactionId = transaction->transactionId;
@@ -182,11 +181,6 @@ void Transaction::initialize(Connection*
 					++numberStates;
 					ASSERT(transaction->transactionId == state->transactionId);
 					}
-				else
-					{
-					INTERLOCKED_DECREMENT(transaction->dependencies);
-					transaction->release();
-					}
 				}
 
 	state = Active;
@@ -247,7 +241,6 @@ void Transaction::commit()
 
 	TransactionManager *transactionManager = database->transactionManager;
 	addRef();
-
 	Log::log(LogXARecovery, "%d: Commit transaction %d\n", database->deltaTime, transactionId);
 
 	if (state == Active)
@@ -323,8 +316,6 @@ void Transaction::commit()
 
 void Transaction::commitNoUpdates(void)
 {
-	//Sync sync(&syncObject, "Transaction::commitNoUpdates");
-	//sync.lock(Exclusive);
 	TransactionManager *transactionManager = database->transactionManager;
 	addRef();
 	ASSERT(!deferredIndexes);
@@ -342,45 +333,18 @@ void Transaction::commitNoUpdates(void)
 
 	Sync syncActiveTransactions(&transactionManager->activeTransactions.syncObject, "Transaction::commitNoUpdates");
 	syncActiveTransactions.lock(Shared);
-	releaseDependencies();
-	Thread *thread = NULL;
-	//Sync syncInit(&transactionManager->syncInitialize, "Transaction::commitNoUpdate");
-	//syncInit.lock(Shared);
 	state = CommittingReadOnly;
-
-	for (int n = 0; dependencies && n < 10; ++n)
-		{
-		int initial = dependencies;
-		transactionManager->expungeTransaction(this);
-
-		if (dependencies && n < 3)
-			{
-			Log::debug("dangling dependencies for tid %d (%d/%d/%d)\n", transactionId, n, initial, dependencies);
-
-			for (Transaction *t = transactionManager->activeTransactions.first; t; t = t->next)
-				{
-				t->print();
-
-				for (int s = 0; s < t->numberStates; ++s)
-					//ASSERT(t->states[s].transaction && t->states[s].transactionId != transactionId); // wrong
-					//ASSERT(t->states[s].transactionId != transactionId || !t->states[s].transaction); // right
-					Log::debug("dependency from tid %d still present\n", t->transactionId);
-				}
-			}
-
-		if (dependencies)
-			{
-			if (!thread)
-				thread = Thread::getThread("Transaction::CommitNoUpdates");
-
-			thread->sleep(1);
-			}
-		}
+	releaseDependencies();
+	
+	Sync sync(&syncObject, "Transaction::commitNoUpdates");
+	sync.lock(Exclusive);
 
 	if (dependencies)
-		Log::debug("final dangling dependencies for transaction %d\n", transactionId);
-
+		transactionManager->expungeTransaction(this);
 
+	sync.unlock();
+	ASSERT(dependencies == 0);
+	
 	delete [] xid;
 	xid = NULL;
 	xidLength = 0;
@@ -394,8 +358,6 @@ void Transaction::commitNoUpdates(void)
 		
 	state = Available;
 	writePending = false;
-	//syncInit.unlock();
-	//sync.unlock();
 	syncActiveTransactions.unlock();
 	syncActive.unlock();
 	release();
@@ -487,7 +449,9 @@ void Transaction::rollback()
 
 void Transaction::expungeTransaction(Transaction * transaction)
 {
-	for (TransState *s = states, *end = s + numberStates; s < end; ++s)
+	int n = 0;
+	
+	for (TransState *s = states, *end = s + numberStates; s < end; ++s, ++n)
 		if (s->transaction == transaction)
 			{
 			if (COMPARE_EXCHANGE_POINTER(&s->transaction, transaction, NULL))
diff -Nrup a/storage/falcon/TransactionManager.cpp b/storage/falcon/TransactionManager.cpp
--- a/storage/falcon/TransactionManager.cpp	2008-01-30 01:57:56 -05:00
+++ b/storage/falcon/TransactionManager.cpp	2008-02-03 13:49:21 -05:00
@@ -370,7 +370,6 @@ void TransactionManager::removeCommitted
 
 void TransactionManager::expungeTransaction(Transaction *transaction)
 {
-	//Sync sync(&syncInitialize, "TransactionManager::expungeTransaction");
 	Sync syncActiveTrans(&activeTransactions.syncObject, "TransactionManager::removeTransaction");
 	syncActiveTrans.lock(Shared);
 
Thread
bk commit into 6.0 tree (jas:1.2792)U-ROWVWADEjas3 Feb