MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:January 26 2009 5:29pm
Subject:bzr commit into mysql-6.0-falcon-team branch (christopher.powers:2974)
Bug#41663
View as plain text  
#At file:///home/cpowers/work/dev/dev-04/mysql/

 2974 Christopher Powers	2009-01-26
      Bug #41663, "Falcon assertion (deferredIndex->virtualOffset) failed at Index.cpp:264"
      
      Don't try to chill empty deferred indexes.
modified:
  storage/falcon/DeferredIndex.cpp
  storage/falcon/DeferredIndex.h
  storage/falcon/Index.cpp

per-file messages:
  storage/falcon/DeferredIndex.cpp
    DeferredIndex::chill()
        
    If virtualOffset == 0 after logIndexUpdates(), then nothing
    was chilled, so don't release the deferred index resources.
  storage/falcon/DeferredIndex.h
    DeferredIndex::chill() - return bool
  storage/falcon/Index.cpp
    Index::getDeferredIndex()
    - Only attempt to chill deferred indexes with 1 or more nodes
    - Only set deferredIndex = NULL if the chill completed successfully
      storage/falcon/RecordLeaf.cpp
=== modified file 'storage/falcon/DeferredIndex.cpp'
--- a/storage/falcon/DeferredIndex.cpp	2008-11-14 15:38:44 +0000
+++ b/storage/falcon/DeferredIndex.cpp	2009-01-26 17:29:41 +0000
@@ -843,7 +843,7 @@ void DeferredIndex::detachTransaction(vo
 	//releaseRef();
 }
 
-void DeferredIndex::chill(Dbb *dbb)
+bool DeferredIndex::chill(Dbb *dbb)
 {
 	Sync sync(&syncObject, "DeferredIndex::chill");
 	sync.lock(Exclusive);
@@ -852,23 +852,34 @@ void DeferredIndex::chill(Dbb *dbb)
 		window = dbb->serialLog->setWindowInterest();
 		
 	dbb->logIndexUpdates(this);
-
-	// Free up the space used by this DeferredIndex
-
-	freeHunks();
-	initializeSpace();
-	levels = 0;
-	DILeaf *leaf = (DILeaf*) alloc(sizeof(DILeaf));
-	leaf->count = 0;
-	root = leaf;
-	count = 0;
-	minValue = NULL;
-	maxValue = NULL;
-	haveMinValue = true;
-	haveMaxValue = true;
-
-	Log::log(LogInfo, "%d: Index chill: transaction %ld, index %ld, %ld bytes, address %p, vofs %llx\n",
+	
+	if (virtualOffset > 0)
+		{
+		// Virtual offset will be > 0 if chill was successful.
+		// Free up the space used by this DeferredIndex.
+	
+		freeHunks();
+		initializeSpace();
+		levels = 0;
+		DILeaf *leaf = (DILeaf*) alloc(sizeof(DILeaf));
+		leaf->count = 0;
+		root = leaf;
+		count = 0;
+		minValue = NULL;
+		maxValue = NULL;
+		haveMinValue = true;
+		haveMaxValue = true;
+
+		Log::log(LogInfo, "%d: Index chill: transaction %ld, index %ld, %ld bytes, address %p, vofs %llx\n",
+					dbb->database->deltaTime, transaction->transactionId, index->indexId, sizeEstimate, this, virtualOffset);
+		}
+	else
+		{
+		Log::log(LogInfo, "%d: Index chill: transaction %ld, index %ld, %ld bytes, address %p, vofs %llx - NOT CHILLED\n",
 				dbb->database->deltaTime, transaction->transactionId, index->indexId, sizeEstimate, this, virtualOffset);
+		}
+	
+	return virtualOffset > 0;
 }
 
 DINode* DeferredIndex::findMaxValue(void)

=== modified file 'storage/falcon/DeferredIndex.h'
--- a/storage/falcon/DeferredIndex.h	2008-10-16 02:53:35 +0000
+++ b/storage/falcon/DeferredIndex.h	2009-01-26 17:29:41 +0000
@@ -86,7 +86,7 @@ public:
 	void			detachIndex(void);
 	void			detachTransaction(void);
 	void			scanIndex (IndexKey *lowKey, IndexKey *highKey, int searchFlags, Bitmap *bitmap);
-	void			chill(Dbb *dbb);
+	bool			chill(Dbb *dbb);
 
 	int				checkTail(uint position, DINode* node);
 	int				checkTail(uint position, IndexKey *indexKey);

=== modified file 'storage/falcon/Index.cpp'
--- a/storage/falcon/Index.cpp	2009-01-22 18:52:19 +0000
+++ b/storage/falcon/Index.cpp	2009-01-26 17:29:41 +0000
@@ -257,12 +257,14 @@ DeferredIndex *Index::getDeferredIndex(T
 		(type != UniqueIndex) && 
 		(transaction->scanIndexCount == 0))
 		{
-		if (deferredIndex->sizeEstimate > database->configuration->indexChillThreshold)
+
+		// Scavenge (or chill) this DeferredIndex and get a new one
+		
+		if (deferredIndex->count > 0 &&
+			deferredIndex->sizeEstimate > database->configuration->indexChillThreshold)
 			{
-			// Scavenge (or chill) this DeferredIndex and get a new one
-			deferredIndex->chill(dbb);
-			ASSERT(deferredIndex->virtualOffset);
-			deferredIndex = NULL;
+			if (deferredIndex->chill(dbb))
+				deferredIndex = NULL;
 			}
 		}
 

Thread
bzr commit into mysql-6.0-falcon-team branch (christopher.powers:2974)Bug#41663Christopher Powers26 Jan