List:Commits« Previous MessageNext Message »
From:klewis Date:April 11 2008 11:26pm
Subject:bk commit into 6.0 tree (klewis:1.2640) 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-11 16:26:15-05:00, klewis@klewis-mysql. +5 -0
  Bug#35692 - Protect fetchVersion with a syncPrior.
  Also, prevent a potential deadlock in deleteRecord
  if syncPrior is help too long.  It is now only held 
  during fetvhVersion.

  storage/falcon/Record.cpp@stripped, 2008-04-11 16:25:49-05:00, klewis@klewis-mysql. +5 -0
    Bug#35692 - Protect fetchVersion with a syncPrior.

  storage/falcon/Record.h@stripped, 2008-04-11 16:25:56-05:00, klewis@klewis-mysql. +2 -1
    Bug#35692 - Protect fetchVersion with a syncPrior.

  storage/falcon/RecordVersion.cpp@stripped, 2008-04-11 16:25:59-05:00, klewis@klewis-mysql.
+10 -2
    Bug#35692 - Protect fetchVersion with a syncPrior.

  storage/falcon/RecordVersion.h@stripped, 2008-04-11 16:26:02-05:00, klewis@klewis-mysql. +2
-1
    Bug#35692 - Protect fetchVersion with a syncPrior.

  storage/falcon/Table.cpp@stripped, 2008-04-11 16:26:04-05:00, klewis@klewis-mysql. +1 -4
    Bug#35692 - prevent a potential deadlock in deleteRecord
    if syncPrior is help too long.  It is now only held 
    during fetvhVersion.

diff -Nrup a/storage/falcon/Record.cpp b/storage/falcon/Record.cpp
--- a/storage/falcon/Record.cpp	2008-04-09 09:51:44 -05:00
+++ b/storage/falcon/Record.cpp	2008-04-11 16:25:49 -05:00
@@ -310,6 +310,11 @@ Record* Record::fetchVersion(Transaction
 	return this;
 }
 
+Record* Record::fetchVersionRecursive(Transaction * transaction)
+{
+	return this;
+}
+
 void Record::getValue(int fieldId, Value * value)
 {
 	getRawValue(fieldId, value);
diff -Nrup a/storage/falcon/Record.h b/storage/falcon/Record.h
--- a/storage/falcon/Record.h	2008-04-09 09:51:48 -05:00
+++ b/storage/falcon/Record.h	2008-04-11 16:25:56 -05:00
@@ -75,7 +75,8 @@ public:
 	virtual TransId	getTransactionId();
 	virtual int		getSavePointId();
 	virtual void	setSuperceded (bool flag);
-	virtual Record*	fetchVersion (Transaction *transaction);
+	virtual Record*	fetchVersion (Transaction * transaction);
+	virtual Record*	fetchVersionRecursive (Transaction *transaction);
 	virtual bool	scavenge(RecordScavenge *recordScavenge, LockType lockType);
 	virtual void	scavenge(TransId targetTransactionId, int oldestActiveSavePointId);
 	virtual bool	isVersion();
diff -Nrup a/storage/falcon/RecordVersion.cpp b/storage/falcon/RecordVersion.cpp
--- a/storage/falcon/RecordVersion.cpp	2008-04-10 00:32:31 -05:00
+++ b/storage/falcon/RecordVersion.cpp	2008-04-11 16:25:59 -05:00
@@ -120,6 +120,14 @@ Record* RecordVersion::releaseNonRecursi
 
 Record* RecordVersion::fetchVersion(Transaction * trans)
 {
+	Sync syncPrior(format->table->getSyncPrior(this), "RecordVersion::fetchVersion");
+	syncPrior.lock(Shared);
+
+	return fetchVersionRecursive(trans);
+}
+
+Record* RecordVersion::fetchVersionRecursive(Transaction * trans)
+{
 	// Unless the record is at least as old as the transaction, it's not for us
 
 	Transaction *recTransaction = transaction;
@@ -144,7 +152,7 @@ Record* RecordVersion::fetchVersion(Tran
 	if (!priorVersion)
 		return NULL;
 		
-	return priorVersion->fetchVersion(trans);
+	return priorVersion->fetchVersionRecursive(trans);
 }
 
 Record* RecordVersion::rollback(Transaction *transaction)
@@ -238,7 +246,7 @@ void RecordVersion::scavenge(TransId tar
 	if (!priorVersion)
 		return;
 
-	Sync syncPrior(getSyncPrior(), "RecordVersion::scavenge(2)");
+	Sync syncPrior(getSyncPrior(), "RecordVersion::scavenge()-savepoint");
 	syncPrior.lock(Shared);
 	
 	Record *rec = priorVersion;
diff -Nrup a/storage/falcon/RecordVersion.h b/storage/falcon/RecordVersion.h
--- a/storage/falcon/RecordVersion.h	2008-04-09 09:51:56 -05:00
+++ b/storage/falcon/RecordVersion.h	2008-04-11 16:26:02 -05:00
@@ -46,7 +46,8 @@ public:
 	virtual void		scavenge(TransId targetTransactionId, int oldestActiveSavePoint);
 	virtual bool		isVersion();
 	virtual Record*		rollback(Transaction *transaction);
-	virtual Record*		fetchVersion (Transaction *transaction);
+	virtual Record*		fetchVersion (Transaction * trans);
+	virtual Record*		fetchVersionRecursive (Transaction *transaction);
 	virtual Record*		releaseNonRecursive();
 	virtual Record*		clearPriorVersion(void);
 	virtual void		setPriorVersion (Record *oldVersion);
diff -Nrup a/storage/falcon/Table.cpp b/storage/falcon/Table.cpp
--- a/storage/falcon/Table.cpp	2008-04-11 12:34:16 -05:00
+++ b/storage/falcon/Table.cpp	2008-04-11 16:26:04 -05:00
@@ -1417,9 +1417,6 @@ void Table::deleteRecord(Transaction * t
 	database->preUpdate();
 	Sync scavenge(&syncScavenge, "Table::deleteRecord");
 
-	Sync syncPrior(getSyncPrior(orgRecord), "Table::deleteRecord");
-	syncPrior.lock(Shared);
-	
 	Record *candidate = fetch(orgRecord->recordNumber);
 	checkAncestor(candidate, orgRecord);
 	RecordVersion *record;
@@ -3747,7 +3744,7 @@ int32 Table::backlogRecord(RecordVersion
 
 void Table::deleteRecordBacklog(int32 recordNumber)
 {
-	Sync sync(&syncObject, "Table::rollbackRecord");
+	Sync sync(&syncObject, "Table::deleteRecordBacklog");
 	sync.lock(Shared);
 	int32 backlogId = backloggedRecords->get(recordNumber);
 	
Thread
bk commit into 6.0 tree (klewis:1.2640) BUG#35692klewis11 Apr