List:Commits« Previous MessageNext Message »
From:cpowers Date:April 11 2008 5:34pm
Subject:bk commit into 6.0 tree (cpowers:1.2638) BUG#35322
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of cpowers.  When cpowers 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-04-11 12:34:18-05:00, cpowers@stripped +1 -0
  Bug#35322, "Falcon duplicate primary keys on updateable views"
  
  Table::checkUniqueRecordVersion() locks record version chain before scanning.
  
  
  Bug#35982, "Falcon crashes on concurrent load data infile"
  
  Table::garbageCollect() checks for null record pointers before passing to Sync constructor.

  storage/falcon/Table.cpp@stripped, 2008-04-11 12:34:16-05:00, cpowers@stripped +13 -3
    Table::garbageCollect() - Check for null record pointers before passing to Sync constructor.
    
    Table::checkUniqueRecordVersion()
    
    This method scans the prior versions of a record, looking for duplicates that
    might indicate an update conflict with another transaction. If necessary, the
    method waits for the other transaction when a conflict is detected.
    
    Added a shared lock on the prior version chain to ensure it is not modified
    during the scan. The lock is released before waiting for another transaction.
    
    
    
    

diff -Nrup a/storage/falcon/Table.cpp b/storage/falcon/Table.cpp
--- a/storage/falcon/Table.cpp	2008-04-10 00:32:31 -05:00
+++ b/storage/falcon/Table.cpp	2008-04-11 12:34:16 -05:00
@@ -2047,9 +2047,12 @@ void Table::expungeBlob(Value * blob)
 	dbb->expungeRecord(section, recordNumber);
 }
 
-void Table::garbageCollect(Record * leaving, Record * staying, Transaction *transaction, bool quiet)
+void Table::garbageCollect(Record *leaving, Record *staying, Transaction *transaction, bool quiet)
 {
-	Sync syncPrior(getSyncPrior(leaving), "Table::garbageCollect");
+	if (!leaving && !staying)
+		return;
+
+	Sync syncPrior(getSyncPrior(leaving ? leaving : staying), "Table::garbageCollect");
 	syncPrior.lock(Shared);
 	
 	// Clean up field indexes
@@ -2500,6 +2503,9 @@ bool Table::checkUniqueRecordVersion(int
 	if ( !(rec = fetch(recordNumber)) )
 		return false;	 // Check next record number.
 
+	Sync syncPrior(getSyncPrior(recordNumber), "Table::checkUniqueRecordVersion");
+	syncPrior.lock(Shared);
+	
 	for (Record *dup = rec; dup; dup = dup->getPriorVersion())
 		{
 		if (dup == record)
@@ -2571,7 +2577,9 @@ bool Table::checkUniqueRecordVersion(int
 			{
 			if (state == Active)
 				{
-				// wait for that transaction, then restart checkUniqueIndexes()
+				syncPrior.unlock(); // release lock before wait
+				
+				// Wait for that transaction, then restart checkUniqueIndexes()
 
 				state = transaction->getRelativeState(dup, WAIT_IF_ACTIVE);
 
@@ -2588,6 +2596,8 @@ bool Table::checkUniqueRecordVersion(int
 
 			else if (activeTransaction)
 				{
+				syncPrior.unlock(); // release lock before wait
+
 				state = transaction->getRelativeState(activeTransaction,
 						activeTransaction->transactionId, WAIT_IF_ACTIVE);
 
Thread
bk commit into 6.0 tree (cpowers:1.2638) BUG#35322cpowers11 Apr