List:Commits« Previous MessageNext Message »
From:klewis Date:April 9 2008 2:52pm
Subject:bk commit into 6.0 tree (klewis:1.2633) BUG#35692
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of klewis.  When klewis 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-09 09:52:11-05:00, klewis@klewis-mysql. +6 -0
  More changes for Bug#35692
  Now that priorVersion is a protected variable, we should have
  a separate routine for clearing it when the caller is going to 
  do the release.
  expungeRecordVersions() does not need to lock syncPrior since in all 
  possible call stacks the exclusive lock is already taken.  
  This causes a single thread deadlock on Linux where we do not use
  recursive mutexes.

  storage/falcon/Record.cpp@stripped, 2008-04-09 09:51:44-05:00, klewis@klewis-mysql. +6 -0
    Now that priorVersion is a protected variable, we should have
    a separate routine for clearing it when the caller is going to 
    do the release

  storage/falcon/Record.h@stripped, 2008-04-09 09:51:48-05:00, klewis@klewis-mysql. +5 -4
    Now that priorVersion is a protected variable, we should have
    a separate routine for clearing it when the caller is going to 
    do the release

  storage/falcon/RecordLeaf.cpp@stripped, 2008-04-09 09:51:51-05:00, klewis@klewis-mysql. +2 -2
    Cleanup

  storage/falcon/RecordVersion.cpp@stripped, 2008-04-09 09:51:53-05:00, klewis@klewis-mysql. +12 -4
    Now that priorVersion is a protected variable, we should have
    a separate routine for clearing it when the caller is going to 
    do the release

  storage/falcon/RecordVersion.h@stripped, 2008-04-09 09:51:56-05:00, klewis@klewis-mysql. +1 -0
    Now that priorVersion is a protected variable, we should have
    a separate routine for clearing it when the caller is going to 
    do the release

  storage/falcon/Table.cpp@stripped, 2008-04-09 09:51:58-05:00, klewis@klewis-mysql. +1 -9
    In rollbackRecord(), syncPrior will be deleted as it goes out of scope.
    No need to do it explicitly.
    expungeRecordVersions() does not need to lock syncPrior since in all 
    possible call stacks the exclusive lock is already taken.  
    This causes a single thread deadlock on Linux where we do not use
    recursive mutexes.

diff -Nrup a/storage/falcon/Record.cpp b/storage/falcon/Record.cpp
--- a/storage/falcon/Record.cpp	2008-04-09 03:23:49 -05:00
+++ b/storage/falcon/Record.cpp	2008-04-09 09:51:44 -05:00
@@ -833,6 +833,12 @@ Record* Record::releaseNonRecursive(void
 	return NULL;
 }
 
+Record* Record::clearPriorVersion(void)
+{
+	ASSERT(false);
+	return NULL;
+}
+
 void Record::setPriorVersion(Record* record)
 {
 	ASSERT(false);
diff -Nrup a/storage/falcon/Record.h b/storage/falcon/Record.h
--- a/storage/falcon/Record.h	2008-04-09 03:23:49 -05:00
+++ b/storage/falcon/Record.h	2008-04-09 09:51:48 -05:00
@@ -75,16 +75,17 @@ public:
 	virtual TransId	getTransactionId();
 	virtual int		getSavePointId();
 	virtual void	setSuperceded (bool flag);
-	virtual Record* fetchVersion (Transaction *transaction);
+	virtual Record*	fetchVersion (Transaction *transaction);
 	virtual bool	scavenge(RecordScavenge *recordScavenge, LockType lockType);
 	virtual void	scavenge(TransId targetTransactionId, int oldestActiveSavePointId);
 	virtual bool	isVersion();
 	virtual bool	isSuperceded();
 	virtual bool	isNull(int fieldId);
-	virtual Record* releaseNonRecursive(void);
+	virtual Record*	releaseNonRecursive(void);
+	virtual Record*	clearPriorVersion(void);
 	virtual void	setPriorVersion(Record* record);
-	virtual Record* getPriorVersion();
-	virtual Record* getGCPriorVersion(void);
+	virtual Record*	getPriorVersion();
+	virtual Record*	getGCPriorVersion(void);
 	virtual	void	print(void);
 	virtual int		thaw();
 	virtual const char*	getEncodedRecord();
diff -Nrup a/storage/falcon/RecordLeaf.cpp b/storage/falcon/RecordLeaf.cpp
--- a/storage/falcon/RecordLeaf.cpp	2008-04-09 03:23:49 -05:00
+++ b/storage/falcon/RecordLeaf.cpp	2008-04-09 09:51:51 -05:00
@@ -134,7 +134,7 @@ int RecordLeaf::retireRecords (Table *ta
 				++count;
 			else if (record->isVersion())
 				{
-				Sync syncPrior(record->getSyncPrior(), "RecordVersion::scavenge");
+				Sync syncPrior(record->getSyncPrior(), "RecordLeaf::retireRecords1");
 				syncPrior.lock(Shared);
 	
 				if (record->scavenge(recordScavenge, Shared))
@@ -167,7 +167,7 @@ int RecordLeaf::retireRecords (Table *ta
 			{
 			if (record->isVersion())
 				{
-				Sync syncPrior(record->getSyncPrior(), "RecordVersion::scavenge");
+				Sync syncPrior(record->getSyncPrior(), "RecordLeaf::retireRecords2");
 				syncPrior.lock(Exclusive);
 				
 				if (record->scavenge(recordScavenge, Exclusive))
diff -Nrup a/storage/falcon/RecordVersion.cpp b/storage/falcon/RecordVersion.cpp
--- a/storage/falcon/RecordVersion.cpp	2008-04-09 03:23:49 -05:00
+++ b/storage/falcon/RecordVersion.cpp	2008-04-09 09:51:53 -05:00
@@ -300,15 +300,23 @@ bool RecordVersion::isSuperceded()
 	return superceded;
 }
 
+// Set the priorVersion to NULL and return its pointer.
+// The caller is responsivble for releasing the associated useCount.
+
+Record* RecordVersion::clearPriorVersion(void)
+{
+	Record * prior = priorVersion;
+	priorVersion = NULL;
+	return prior;
+}
+
 void RecordVersion::setPriorVersion(Record *oldVersion)
 {
 	if (oldVersion)
-		{
 		oldVersion->addRef();
 
-		if (priorVersion)
-			priorVersion->release();
-		}
+	if (priorVersion)
+		priorVersion->release();
 
 	priorVersion = oldVersion;
 }
diff -Nrup a/storage/falcon/RecordVersion.h b/storage/falcon/RecordVersion.h
--- a/storage/falcon/RecordVersion.h	2008-04-09 03:23:49 -05:00
+++ b/storage/falcon/RecordVersion.h	2008-04-09 09:51:56 -05:00
@@ -48,6 +48,7 @@ public:
 	virtual Record*		rollback(Transaction *transaction);
 	virtual Record*		fetchVersion (Transaction *transaction);
 	virtual Record*		releaseNonRecursive();
+	virtual Record*		clearPriorVersion(void);
 	virtual void		setPriorVersion (Record *oldVersion);
 	virtual void		setVirtualOffset(uint64 offset);
 	virtual uint64		getVirtualOffset();
diff -Nrup a/storage/falcon/Table.cpp b/storage/falcon/Table.cpp
--- a/storage/falcon/Table.cpp	2008-04-09 03:23:49 -05:00
+++ b/storage/falcon/Table.cpp	2008-04-09 09:51:58 -05:00
@@ -1005,9 +1005,6 @@ Record* Table::rollbackRecord(RecordVers
 
 	if (backloggedRecords)
 		deleteRecordBacklog(recordToRollback->recordNumber);
-		
-	if (syncPrior)
-		delete syncPrior;
 			
 	return priorRecord;
 }
@@ -1911,12 +1908,7 @@ void Table::expungeRecordVersions(Record
 {
 	ASSERT(record->state != recLock);
 
-	Sync syncPrior(getSyncPrior(record), "Table::expungeRecordVersions");
-	syncPrior.lock(Exclusive);
-	
-	Record *prior = record->getPriorVersion();
-	//record->priorVersion = NULL;
-	record->setPriorVersion(NULL);
+	Record *prior = record->clearPriorVersion();
 	
 	if (recordScavenge)
 		for (Record *rec = prior; rec; rec = rec->getPriorVersion())
Thread
bk commit into 6.0 tree (klewis:1.2633) BUG#35692klewis9 Apr