List:Commits« Previous MessageNext Message »
From:lars-erik.bjork Date:January 21 2009 8:12am
Subject:bzr commit into mysql-6.0-falcon-team branch (lars-erik.bjork:2966)
View as plain text  
#At file:///home/lb200670/devel/mysql/clean/ based on revid:lars-erik.bjork@stripped

 2966 lars-erik.bjork@stripped	2009-01-21 [merge]
      Merging ...
modified:
  mysql-test/suite/falcon/r/falcon_online_index.result
  mysql-test/suite/falcon/t/falcon_online_index.test
  storage/falcon/Record.h
  storage/falcon/SRLUpdateRecords.cpp
  storage/falcon/SRLUpdateRecords.h
  storage/falcon/Table.cpp
  storage/falcon/Table.h

=== modified file 'mysql-test/suite/falcon/r/falcon_online_index.result'
--- a/mysql-test/suite/falcon/r/falcon_online_index.result	2009-01-15 20:36:06 +0000
+++ b/mysql-test/suite/falcon/r/falcon_online_index.result	2009-01-21 00:28:07 +0000
@@ -134,6 +134,9 @@ ALTER ONLINE TABLE t1 DROP PRIMARY KEY;
 SHOW INDEXES FROM t1;
 Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
 ALTER ONLINE TABLE t1 ADD PRIMARY KEY (a);
+SHOW INDEXES FROM t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
+t1	0	PRIMARY	1	a	NULL	10	NULL	NULL		BTREE		
 #-------- Test: UNIQUE --------#
 ALTER ONLINE TABLE t2 ADD UNIQUE INDEX ix_unique_c (c);
 EXPLAIN SELECT * FROM t2 WHERE c < 25 AND c > 20 ORDER BY c;

=== modified file 'mysql-test/suite/falcon/t/falcon_online_index.test'
--- a/mysql-test/suite/falcon/t/falcon_online_index.test	2009-01-15 20:36:06 +0000
+++ b/mysql-test/suite/falcon/t/falcon_online_index.test	2009-01-21 00:28:07 +0000
@@ -198,6 +198,7 @@ ALTER ONLINE TABLE t1 DROP PRIMARY KEY;
 SHOW INDEXES FROM t1;
 # Re-set primary key on 'a'
 ALTER ONLINE TABLE t1 ADD PRIMARY KEY (a);
+SHOW INDEXES FROM t1;
 
 ##
 ## Testing some statement variations using ADD/DROP INDEX

=== modified file 'storage/falcon/Record.h'
--- a/storage/falcon/Record.h	2009-01-09 22:00:52 +0000
+++ b/storage/falcon/Record.h	2009-01-17 08:22:44 +0000
@@ -27,7 +27,7 @@
 #define ALLOCATE_RECORD(n)		(char*) MemMgrRecordAllocate (n, __FILE__, __LINE__)
 #define DELETE_RECORD(record)	MemMgrRecordDelete (record);
 
-#define CHECK_RECORD_ACTIVITY
+//#define CHECK_RECORD_ACTIVITY
 
 #include "SynchronizationObject.h"
 

=== modified file 'storage/falcon/SRLUpdateRecords.cpp'
--- a/storage/falcon/SRLUpdateRecords.cpp	2008-11-19 17:00:02 +0000
+++ b/storage/falcon/SRLUpdateRecords.cpp	2009-01-21 00:35:50 +0000
@@ -28,6 +28,7 @@
 #include "Sync.h"
 #include "SerialLogWindow.h"
 #include "Format.h"
+#include "SQLError.h"
 
 SRLUpdateRecords::SRLUpdateRecords(void)
 {
@@ -37,8 +38,26 @@ SRLUpdateRecords::~SRLUpdateRecords(void
 {
 }
 
-void SRLUpdateRecords::chill(Transaction *transaction, RecordVersion *record, uint dataLength)
+bool SRLUpdateRecords::chill(Transaction *transaction, RecordVersion *record, uint dataLength)
 {
+	Sync syncPrior(record->getSyncPrior(), "SRLUpdateRecords::chill");
+	
+	// Exclusively lock the record chain before chilling the record. Use a 50ms wait to defer
+	// to other tasks accessing the record chain.
+	//
+	// This is a provisional resolution to a syncPrior/syncWrite deadlock that can be triggered
+	// by a low-level thaw on a concurrent thread already holding syncPrior. Such a deadlock
+	// can occur while pruning record versions during during a scavenge.
+	
+	try
+		{
+		syncPrior.lock(Exclusive, 50);
+		}
+	catch (...)
+		{
+		return false;
+		}
+	
 	// Record data has been written to the serial log, so release the data
 	// buffer and set the state accordingly
 	
@@ -55,6 +74,8 @@ void SRLUpdateRecords::chill(Transaction
 		transaction->totalRecordData -= dataLength;
 	else
 		transaction->totalRecordData = 0;
+		
+	return true;
 }
 
 int SRLUpdateRecords::thaw(RecordVersion *record, bool *thawed)
@@ -200,15 +221,16 @@ void SRLUpdateRecords::append(Transactio
 					{
 					int chillBytes = record->getEncodedSize();
 
-					chill(transaction, record, chillBytes);
-					
-					log->chilledRecords++;
-					log->chilledBytes += chillBytes;
+					if (chill(transaction, record, chillBytes))
+						{
+						log->chilledRecords++;
+						log->chilledBytes += chillBytes;
 					
-					ASSERT(transaction->thawedRecords > 0);
+						//ASSERT(transaction->thawedRecords > 0);
 
-					if (transaction->thawedRecords)
-						transaction->thawedRecords--;
+						if (transaction->thawedRecords)
+							transaction->thawedRecords--;
+						}
 					}
 				else
 					{
@@ -253,9 +275,11 @@ void SRLUpdateRecords::append(Transactio
 			
 			if (chillRecords && record->state != recDeleted)
 				{
-				chill(transaction, record, stream.totalLength);
-				chilledRecordsWindow++;
-				chilledBytesWindow += stream.totalLength;
+				if (chill(transaction, record, stream.totalLength))
+					{
+					chilledRecordsWindow++;
+					chilledBytesWindow += stream.totalLength;
+					}
 				}
 			} // next record version
 		

=== modified file 'storage/falcon/SRLUpdateRecords.h'
--- a/storage/falcon/SRLUpdateRecords.h	2008-11-14 02:30:11 +0000
+++ b/storage/falcon/SRLUpdateRecords.h	2009-01-17 08:22:44 +0000
@@ -33,7 +33,7 @@ public:
 	virtual void	read(void);
 	virtual void	pass2(void);
 	void			append(Transaction *transaction, RecordVersion *records, bool chillRecords = false);
-	void			chill(Transaction *transaction, RecordVersion *record, uint dataLength);
+	bool			chill(Transaction *transaction, RecordVersion *record, uint dataLength);
 	int				thaw(RecordVersion *record, bool *thawed);
 	
 	const UCHAR		*data;

=== modified file 'storage/falcon/Table.cpp'
--- a/storage/falcon/Table.cpp	2009-01-15 20:29:54 +0000
+++ b/storage/falcon/Table.cpp	2009-01-17 08:51:59 +0000
@@ -2555,6 +2555,9 @@ bool Table::checkUniqueRecordVersion(int
 			if (dup->state == recLock)
 				continue;  // Next record version.
 
+			if (dup->state == recRollback)
+				continue;  // Next record version.
+			
 			// The record has been deleted.
 			ASSERT(dup->state == recDeleted);
 

=== modified file 'storage/falcon/Table.h'
--- a/storage/falcon/Table.h	2009-01-15 20:29:54 +0000
+++ b/storage/falcon/Table.h	2009-01-17 08:22:44 +0000
@@ -42,8 +42,8 @@ static const int PostCommit	= 128;
 
 static const int BL_SIZE			= 128;
 static const int FORMAT_HASH_SIZE	= 20;
-static const int SYNC_VERSIONS_SIZE	= 16;
-static const int SYNC_THAW_SIZE		= 16;
+static const int SYNC_VERSIONS_SIZE	= 32; // 16;
+static const int SYNC_THAW_SIZE		= 32; // 16;
 
 #define FOR_FIELDS(field,table)	{for (Field *field=table->fields; field; field = field->next){
 

Thread
bzr commit into mysql-6.0-falcon-team branch (lars-erik.bjork:2966) lars-erik.bjork21 Jan