List:Commits« Previous MessageNext Message »
From:Kevin Lewis Date:December 3 2008 6:37pm
Subject:bzr commit into mysql-6.0-falcon-team branch (klewis:2923) Bug#41194
View as plain text  
#At file:///C:/Work/bzr/Merge/mysql-6.0-falcon-team/

 2923 Kevin Lewis	2008-12-03
      Bug#41194 - The point in time in which a transaction
      is visible as committed by all other transactions
      should not occur before the point of durability.
      Durability occurs when the commit record is written
      to the serial log.  This is the call to
      database->commit(this) in Transaction::commit().
      It needs to happen immediately befor the status is
      changed and other waiting transactions are
      signaled.  Then in order to prevent the gopher 
      thread from processing this serialLogTransaction
      before the commit is done, the gopher needs to wait 
      on that transaction
modified:
  storage/falcon/SerialLogTransaction.cpp
  storage/falcon/Transaction.cpp

per-file messages:
  storage/falcon/SerialLogTransaction.cpp
    Bug#41194 - Durability is now done before signaling 
    other transactions. In order to prevent the gopher 
    thread from processing this serialLogTransaction
    before the commit is done, the gopher needs to wait 
    on that transaction.
  storage/falcon/Transaction.cpp
    Bug#41194 - Durability is now done before signaling 
    other transactions.
=== modified file 'storage/falcon/SerialLogTransaction.cpp'
--- a/storage/falcon/SerialLogTransaction.cpp	2008-06-08 22:12:35 +0000
+++ b/storage/falcon/SerialLogTransaction.cpp	2008-12-03 17:38:31 +0000
@@ -70,6 +70,12 @@ SerialLogTransaction::~SerialLogTransact
 void SerialLogTransaction::commit()
 {
 	ASSERT(!transaction || transaction->transactionId == transactionId);
+	ASSERT(transaction->writePending);
+
+	// Be sure this transaction is fully committed.
+
+	transaction->waitForTransaction();
+
 	SerialLogControl control(log);
 	window->activateWindow(true);
 	SerialLogBlock *block = (SerialLogBlock*) (window->buffer + blockOffset);

=== modified file 'storage/falcon/Transaction.cpp'
--- a/storage/falcon/Transaction.cpp	2008-11-20 17:05:50 +0000
+++ b/storage/falcon/Transaction.cpp	2008-12-03 17:38:31 +0000
@@ -300,7 +300,11 @@ void Transaction::commit()
 	releaseDependencies();
 	database->flushInversion(this);
 
-	// Transfer transaction from active list to committed list, set committed state
+	// Write a commit record to the serial log.
+
+	database->commit(this);
+
+	// Transfer transaction from active list to committed list
 
 	Sync syncActiveTransactions(&transactionManager->activeTransactions.syncObject,
"Transaction::commit(2)");
 	Sync syncCommitted(&transactionManager->committedTransactions.syncObject,
"Transaction::commit(3)");
@@ -310,14 +314,14 @@ void Transaction::commit()
 
 	transactionManager->activeTransactions.remove(this);
 	transactionManager->committedTransactions.append(this);
-	state = Committed;
 
 	syncCommitted.unlock();
 	syncActiveTransactions.unlock();
-	
-	syncIsActive.unlock(); // signal waiting transactions
 
-	database->commit(this);
+	// Change the state and signal waiting transactions
+
+	state = Committed;
+	syncIsActive.unlock();
 
 	delete [] xid;
 	xid = NULL;

Thread
bzr commit into mysql-6.0-falcon-team branch (klewis:2923) Bug#41194Kevin Lewis3 Dec