List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:May 31 2007 9:10pm
Subject:bk commit into 6.0-falcon tree (jas:1.2529)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0-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-05-31 17:10:00-04:00, jas@rowvwade. +4 -0
  Change record scavenging (aka retiring) to avoid exclusive
  lock on record turning scavenge operation.  The general
  scavenge operates without a lock on the record tree 
  (nobody else removes RecordSections), getting exclusive
  locks on RecordLeaf's when necessary, and getting Exclusive
  locks on the record tree to remove RecordSections.

  storage/falcon/RecordGroup.cpp@stripped, 2007-05-31 17:09:48-04:00, jas@rowvwade. +13 -2
    Change record scavenging (aka retiring) to avoid exclusive
    lock on record turning scavenge operation.  The general
    scavenge operates without a lock on the record tree 
    (nobody else removes RecordSections), getting exclusive
    locks on RecordLeaf's when necessary, and getting Exclusive
    locks on the record tree to remove RecordSections.

  storage/falcon/RecordLeaf.cpp@stripped, 2007-05-31 17:09:49-04:00, jas@rowvwade. +10 -8
    Change record scavenging (aka retiring) to avoid exclusive
    lock on record turning scavenge operation.  The general
    scavenge operates without a lock on the record tree 
    (nobody else removes RecordSections), getting exclusive
    locks on RecordLeaf's when necessary, and getting Exclusive
    locks on the record tree to remove RecordSections.

  storage/falcon/Table.cpp@stripped, 2007-05-31 17:09:50-04:00, jas@rowvwade. +12 -13
    Change record scavenging (aka retiring) to avoid exclusive
    lock on record turning scavenge operation.  The general
    scavenge operates without a lock on the record tree 
    (nobody else removes RecordSections), getting exclusive
    locks on RecordLeaf's when necessary, and getting Exclusive
    locks on the record tree to remove RecordSections.

  storage/falcon/Table.h@stripped, 2007-05-31 17:09:50-04:00, jas@rowvwade. +1 -1
    Phase out "syncScavenge".

# 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.9/storage/falcon/RecordGroup.cpp	2007-05-31 17:10:22 -04:00
+++ 1.10/storage/falcon/RecordGroup.cpp	2007-05-31 17:10:22 -04:00
@@ -23,6 +23,8 @@
 #include "RecordLeaf.h"
 #include "Record.h"
 #include "Interlock.h"
+#include "Table.h"
+#include "Sync.h"
 
 #ifdef _DEBUG
 static char THIS_FILE[]=__FILE__;
@@ -123,8 +125,17 @@
 				count += n;
 			else
 				{
-				delete section;
-				*ptr = NULL;
+				Sync sync(&table->syncObject, "RecordGroup::retireRecords");
+				sync.lock(Exclusive);
+				n = section->retireRecords(table, recordNumber, age, oldestActiveTransaction);
+				
+				if (n)
+					count += n;
+				else
+					{
+					delete section;
+					*ptr = NULL;
+					}
 				}
 			}
 		}

--- 1.23/storage/falcon/RecordLeaf.cpp	2007-05-31 17:10:22 -04:00
+++ 1.24/storage/falcon/RecordLeaf.cpp	2007-05-31 17:10:22 -04:00
@@ -92,23 +92,27 @@
 	// If we're adding a new version, don't bother with a lock.  Otherwise we need to lock out
 	// simultaneous fetches to avoid a potential race between addRef() and release().
 
-	if (!record || record->getPriorVersion() != prior)
+	if (record && record->getPriorVersion() == prior)
 		{
-		Sync sync(&syncObject, "RecordLeaf::store");
-		sync.lock(Exclusive);
-
 		if (!COMPARE_EXCHANGE_POINTER(records + id, prior, record))
 			return false;
 		}
 	else
+		{
+		Sync sync(&syncObject, "RecordLeaf::store");
+		sync.lock(Exclusive);
+
 		if (!COMPARE_EXCHANGE_POINTER(records + id, prior, record))
 			return false;
+		}
 
 	return true;
 }
 
 int RecordLeaf::retireRecords (Table *table, int base, int age, TransId oldestActiveTransaction)
 {
+	Sync sync(&syncObject, "RecordLeaf::retireRecords");
+	sync.lock(Exclusive);
 	int count = 0;
 
 	for (Record **ptr = records, **end = records + RECORD_SLOTS; ptr < end; ++ptr)
@@ -119,10 +123,8 @@
 			{
 			if (record->isVersion())
 				{
-				if (   (record->scavenge(oldestActiveTransaction))
-				    && (   (!record->hasRecord())
-				        || (   (record->useCount == 1)
-				            && (record->ageGroup <= age))))
+				if ((record->scavenge(oldestActiveTransaction)) &&
+				    ((!record->hasRecord()) || ((record->useCount == 1) && (record->ageGroup <= age))))
 					{
 					*ptr = NULL;
 #ifdef CHECK_RECORD_ACTIVITY

--- 1.109/storage/falcon/Table.cpp	2007-05-31 17:10:22 -04:00
+++ 1.110/storage/falcon/Table.cpp	2007-05-31 17:10:22 -04:00
@@ -981,8 +981,8 @@
 	RecordVersion *record = NULL;
 	bool updated = false;
 	int recordNumber = oldRecord->recordNumber;
-	Sync scavenge(&syncScavenge, "Table::update(2)");
-	scavenge.lock(Shared);
+	//Sync scavenge(&syncScavenge, "Table::update(2)");
+	//scavenge.lock(Shared);
 	
 	try
 		{
@@ -1046,7 +1046,7 @@
 		END_FOR;
 
 		updateInversion(record, transaction);
-		scavenge.unlock();
+		//scavenge.unlock();
 		validateAndInsert(transaction, record);
 		transaction->addRecord(record);
 		updated = true;
@@ -1193,8 +1193,8 @@
 
 void Table::deleteRecord(Transaction * transaction, Record * oldRecord)
 {
-	Sync scavenge(&syncScavenge, "Table::deleteRecord");
-	scavenge.lock(Shared);
+	//Sync scavenge(&syncScavenge, "Table::deleteRecord");
+	//scavenge.lock(Shared);
 	Record *candidate = fetch(oldRecord->recordNumber);
 	checkAncestor(candidate, oldRecord);
 	RecordVersion *record;
@@ -1493,11 +1493,11 @@
 	if (!records)
 		return 0;
 
-	Sync scavenge(&syncScavenge, "Table::retireRecords");
-	scavenge.lock(Exclusive);
+	//Sync scavenge(&syncScavenge, "Table::retireRecords");
+	//scavenge.lock(Exclusive);
 
-	Sync sync(&syncObject, "Table::retireRecords");
-	sync.lock(Exclusive);
+	//Sync sync(&syncObject, "Table::retireRecords");
+	//sync.lock(Exclusive);
 	activeVersions = false;
 	int count = records->retireRecords(this, 0, age, oldestActiveTransaction);
 
@@ -2561,9 +2561,8 @@
 
 	RecordVersion *record = NULL;
 	bool updated = false;
-	Sync scavenge(&syncScavenge, "Table::update");
-	scavenge.lock(Shared);
-	//int orgState = candidate->state;
+	//Sync scavenge(&syncScavenge, "Table::update");
+	//scavenge.lock(Shared);
 	
 	if (candidate->state == recLock && candidate->getTransaction() == transaction)
 		{
@@ -2621,7 +2620,7 @@
 		END_FOR;
 
 		//updateInversion(record, transaction);
-		scavenge.unlock();
+		//scavenge.unlock();
 		
 		if (record->state == recLock)
 			record->state = recData;

--- 1.24/storage/falcon/Table.h	2007-05-31 17:10:22 -04:00
+++ 1.25/storage/falcon/Table.h	2007-05-31 17:10:22 -04:00
@@ -197,7 +197,7 @@
 	Dbb				*dbb;
 	SyncObject		syncObject;
 	SyncObject		syncTriggers;
-	SyncObject		syncScavenge;
+	//SyncObject	syncScavenge;
 	Table			*collision;				// Hash collision in database
 	Table			*idCollision;			// mod(id) collision in database
 	Table			*next;					// next in database linked list
Thread
bk commit into 6.0-falcon tree (jas:1.2529)U-ROWVWADEjas31 May