List:Commits« Previous MessageNext Message »
From:Ann Harrison Date:October 24 2008 8:33pm
Subject:bzr commit into mysql-6.0-falcon-team branch (ann:2778)
View as plain text  
#At file:///C:/MySQL/working/

 2778 Ann Harrison	2008-10-24
      sync repository
modified:
  storage/falcon/BDB.cpp
  storage/falcon/Cache.cpp
  storage/falcon/Cache.h
  storage/falcon/Database.cpp
  storage/falcon/Dbb.cpp
  storage/falcon/Index.cpp
  storage/falcon/Log.h
  storage/falcon/PageInventoryPage.cpp
  storage/falcon/SRLCheckpoint.cpp
  storage/falcon/Section.cpp
  storage/falcon/SerialLog.cpp
  storage/falcon/Transaction.cpp
  storage/falcon/Validation.cpp

=== modified file 'storage/falcon/BDB.cpp'
--- a/storage/falcon/BDB.cpp	2008-09-18 16:41:34 +0000
+++ b/storage/falcon/BDB.cpp	2008-10-24 20:34:05 +0000
@@ -30,7 +30,7 @@
 #include "Sync.h"
 #include "Page.h"
 
-//#define TRACE_PAGE 130049
+#define TRACE_PAGE 22921
 
 #ifdef _DEBUG
 #undef THIS_FILE
@@ -89,7 +89,7 @@ void Bdb::mark(TransId transId)
 
 #ifdef TRACE_PAGE
 	if (pageNumber == TRACE_PAGE)
-		Log::debug("Marking page %d/%d\n", pageNumber, dbb->tableSpaceId);
+		Log::log(LogPageTracing, "Marking page %d/%d\n", pageNumber, dbb->tableSpaceId);
 #endif
 
 	if (!markingThread)
@@ -102,6 +102,13 @@ void Bdb::mark(TransId transId)
 		{
 		isDirty = true;
 		cache->markDirty(this);
+
+		if (buffer->pageType == PAGE_inventory)
+			{
+			Log::log(LogPageTracing, "marking PIP page %d tablespace %d\n",
+				buffer->pageNumber, dbb->tableSpaceId);
+//			cache->markedPIP += 1;
+			}
 		}
 }
 

=== modified file 'storage/falcon/Cache.cpp'
--- a/storage/falcon/Cache.cpp	2008-10-02 23:06:04 +0000
+++ b/storage/falcon/Cache.cpp	2008-10-24 20:34:05 +0000
@@ -49,7 +49,7 @@
 #undef PARAMETER_BOOL
 extern uint falcon_io_threads;
 
-//#define STOP_PAGE		55
+#define STOP_PAGE		22921
 #define TRACE_FILE	"cache.trace"
 
 static FILE			*traceFile;
@@ -102,6 +102,7 @@ Cache::Cache(Database *db, int pageSz, i
 	ioThreads = new Thread*[numberIoThreads];
 	memset(ioThreads, 0, numberIoThreads * sizeof(ioThreads[0]));
 	flushing = false;
+	markedPIP = 0;
 	
 	try
 		{
@@ -217,10 +218,19 @@ Bdb* Cache::fetchPage(Dbb *dbb, int32 pa
 
 #ifdef STOP_PAGE			
 		if (pageNumber == STOP_PAGE)
- 			Log::debug("fetching page %d/%d\n", pageNumber, dbb->tableSpaceId);
+ 			Log::log(LogPageTracing, "fetching page %d/%d\n", pageNumber, dbb->tableSpaceId);
 #endif
 
 	ASSERT (pageNumber >= 0);
+
+	if (pageType != PAGE_inventory &&
+		!PageInventoryPage::isPageInUse (dbb, pageNumber))
+		{
+		Log::log (LogPageTracing, "During recovery, fetched page %d tablespace %d type %d marked free in PIP\n",
+			pageNumber, dbb->tableSpaceId, pageType);
+		PageInventoryPage::markPageInUse(dbb, pageNumber, 0);
+		}
+
 	int slot = pageNumber % hashSize;
 	LockType actual = lockType;
 	Sync sync (&syncObject, "Cache::fetchPage");
@@ -269,7 +279,7 @@ Bdb* Cache::fetchPage(Dbb *dbb, int32 pa
 
 #ifdef STOP_PAGE			
 			if (bdb->pageNumber == STOP_PAGE)
-				Log::debug("reading page %d/%d\n", bdb->pageNumber, dbb->tableSpaceId);
+				Log::log(LogPageTracing, "reading page %d/%d\n", bdb->pageNumber, dbb->tableSpaceId);
 #endif
 			
 			Priority priority(database->ioScheduler);
@@ -329,7 +339,7 @@ Bdb* Cache::fakePage(Dbb *dbb, int32 pag
 
 #ifdef STOP_PAGE			
 	if (pageNumber == STOP_PAGE)
-		Log::debug("faking page %d/%d\n",pageNumber, dbb->tableSpaceId);
+		Log::log(LogPageTracing, "faking page %d/%d\n",pageNumber, dbb->tableSpaceId);
 #endif
 
 	/* If we already have a buffer for this, we're done */
@@ -487,6 +497,13 @@ void Cache::markDirty(Bdb *bdb)
 	lastDirty = bdb;
 	++numberDirtyPages;
 	//validateUnique (bdb);
+
+	if (bdb->buffer->pageType == PAGE_inventory)
+		{
+		++markedPIP;
+		Log::log(LogPageTracing, "in Cache::markDirty PIP page %d tablespace %d (count %d)\n", 
+			bdb->pageNumber, bdb->dbb->tableSpaceId, markedPIP);
+		}
 }
 
 void Cache::markClean(Bdb *bdb)
@@ -516,6 +533,14 @@ void Cache::markClean(Bdb *bdb)
 
 	bdb->nextDirty = NULL;
 	bdb->priorDirty = NULL;
+
+	if (bdb->buffer->pageType == PAGE_inventory)
+		{
+		--markedPIP;
+		Log::log(LogPageTracing, "in Cache::markClean PIP page %d tablespace %d (count %d)\n", 
+			bdb->pageNumber, bdb->dbb->tableSpaceId, markedPIP);
+		}
+
 }
 
 void Cache::writePage(Bdb *bdb, int type)
@@ -591,7 +616,7 @@ void Cache::writePage(Bdb *bdb, int type
 
 #ifdef STOP_PAGE
 	if (bdb->pageNumber == STOP_PAGE)
-		Log::debug("writing page %d/%d\n", bdb->pageNumber, dbb->tableSpaceId);
+		Log::log(LogPageTracing, "writing page %d/%d\n", bdb->pageNumber, dbb->tableSpaceId);
 #endif
 
 	bdb->isDirty = false;
@@ -778,11 +803,15 @@ void Cache::ioThread(void)
 	UCHAR *buffer = (UCHAR*) (((UIPTR) rawBuffer + pageSize - 1) / pageSize * pageSize);
 	UCHAR *end = (UCHAR*) ((UIPTR) (rawBuffer + ASYNC_BUFFER_SIZE) / pageSize * pageSize);
 	flushLock.lock(Exclusive);
-	
+
+
 	// This is the main loop.  Write blocks until there's nothing to do, then sleep
 	
 	for (;;)
 		{
+		if (markedPIP)
+			Log::log(LogPageTracing, "** checkpoint start **\n");
+
 		int32 pageNumber = flushBitmap->nextSet(0);
 		int count;
 		Dbb *dbb;
@@ -827,6 +856,13 @@ void Cache::ioThread(void)
 						bdb->flushIt = false;
 						markClean(bdb);
 						bdb->isDirty = false;
+#ifdef STOP_PAGE			
+						if (bdb->pageNumber == STOP_PAGE)
+ 							Log::log(LogPageTracing, "flushing page %d/%d\n", pageNumber, dbb->tableSpaceId);
+#endif
+						if (bdb->buffer->pageType == PAGE_inventory)
+							Log::log(LogPageTracing, "flushing PIP page %d/%d\n", 
+								bdb->buffer->pageNumber, dbb->tableSpaceId);
 						bdb->release(REL_HISTORY);
 						sync.lock(Shared);
 						
@@ -945,6 +981,8 @@ void Cache::ioThread(void)
 			thread->sleep();
 			flushLock.lock(Exclusive);
 			}
+
+		Log::log(LogPageTracing, "** checkpoint end **\n");
 		}
 	
 	delete [] rawBuffer;			

=== modified file 'storage/falcon/Cache.h'
--- a/storage/falcon/Cache.h	2008-10-02 22:15:11 +0000
+++ b/storage/falcon/Cache.h	2008-10-24 20:34:05 +0000
@@ -81,6 +81,7 @@ public:
 	int			numberBuffers;
 	bool		panicShutdown;
 	bool		flushing;
+	int			markedPIP;
 
 protected:
 	Bdb*		findBuffer (Dbb *dbb, int pageNumber, LockType lockType);

=== modified file 'storage/falcon/Database.cpp'
--- a/storage/falcon/Database.cpp	2008-10-16 02:40:08 +0000
+++ b/storage/falcon/Database.cpp	2008-10-24 20:34:05 +0000
@@ -738,6 +738,7 @@ void Database::openDatabase(const char *
 				}
 			tableSpaceManager->postRecovery();
 			serialLog->start();
+			cache->markedPIP = 0;
 			}
 		else
 			{

=== modified file 'storage/falcon/Dbb.cpp'
--- a/storage/falcon/Dbb.cpp	2008-10-16 02:53:35 +0000
+++ b/storage/falcon/Dbb.cpp	2008-10-24 20:34:05 +0000
@@ -54,7 +54,7 @@
 #include "Table.h"
 
 //#define STOP_RECORD	123
-//#define TRACE_PAGE	109
+#define TRACE_PAGE	22921
 
 static const int SECTION_HASH_SIZE	= 997;
 
@@ -250,7 +250,7 @@ Bdb* Dbb::allocPage(PageType pageType, T
 
 #ifdef TRACE_PAGE
 	if (bdb->pageNumber == TRACE_PAGE)
-		Log::debug("Allocating trace page %d\n", bdb->pageNumber);
+		Log::log(LogPageTracing, "Allocating trace page %d\n", bdb->pageNumber);
 #endif
 
 	if (bdb->pageNumber > highPage)
@@ -595,7 +595,7 @@ void Dbb::freePage(Bdb * bdb, TransId tr
 
 #ifdef TRACE_PAGE
 	if (pageNumber == TRACE_PAGE)
-		Log::debug("Freeing trace page %d\n",pageNumber);
+		Log::log(LogPageTracing, "Freeing trace page %d\n",pageNumber);
 #endif
 
 	//bdb->buffer->pageType = PAGE_free;
@@ -1251,6 +1251,12 @@ void Dbb::logIndexUpdates(DeferredIndex*
 
 bool Dbb::sectionInUse(int sectionId)
 {
+	// The backlog tablespace is set to no logging so
+	// checking in with the serialLog is a bad idea
+
+	if (noLog)
+		return false;
+
 	return serialLog->sectionInUse(sectionId, tableSpaceId);
 }
 

=== modified file 'storage/falcon/Index.cpp'
--- a/storage/falcon/Index.cpp	2008-10-16 02:53:35 +0000
+++ b/storage/falcon/Index.cpp	2008-10-24 20:34:05 +0000
@@ -620,7 +620,11 @@ void Index::garbageCollect(Record * leav
 		if (record->hasRecord() && record->recordNumber >= 0)
 			{
 			IndexKey key(this);
-			makeKey (record, &key);
+
+			if (indexId != -1)
+				makeKey (record, &key);
+			else
+				return;
 
 			if (!duplicateKey(&key, record->getPriorVersion()) && !duplicateKey (&key, staying))
 				{

=== modified file 'storage/falcon/Log.h'
--- a/storage/falcon/Log.h	2007-11-29 22:51:08 +0000
+++ b/storage/falcon/Log.h	2008-10-24 20:34:05 +0000
@@ -38,6 +38,7 @@ static const int	LogScrub		= 128;
 static const int	LogException	= 256;
 static const int	LogScavenge		= 512;
 static const int	LogXARecovery	= 1024;
+static const int	LogPageTracing	= 2048;
 
 typedef void (Listener) (int, const char*, void *arg);
 

=== modified file 'storage/falcon/PageInventoryPage.cpp'
--- a/storage/falcon/PageInventoryPage.cpp	2008-06-17 17:41:54 +0000
+++ b/storage/falcon/PageInventoryPage.cpp	2008-10-24 20:34:05 +0000
@@ -37,7 +37,7 @@
 static const char THIS_FILE[]=__FILE__;
 #endif
 
-//#define STOP_PAGE	98
+#define STOP_PAGE	22921
 
 //////////////////////////////////////////////////////////////////////
 // Construction/Destruction
@@ -109,7 +109,7 @@ Bdb* PageInventoryPage::allocPage(Dbb * 
 
 #ifdef STOP_PAGE
 							if (pageNumber == STOP_PAGE)
-								Log::debug("page %d/%d allocated\n", pageNumber, dbb->tableSpaceId);
+								Log::log(LogPageTracing, "page %d/%d allocated\n", pageNumber, dbb->tableSpaceId);
 #endif
 
 #ifdef DEBUG_INDEX_PAGE
@@ -127,7 +127,7 @@ void PageInventoryPage::freePage(Dbb *db
 {
 #ifdef STOP_PAGE
 	if (pageNumber == STOP_PAGE)
-		Log::debug("page %d/%d released\n", pageNumber, dbb->tableSpaceId);
+		Log::log(LogPageTracing, "page %d/%d released\n", pageNumber, dbb->tableSpaceId);
 #endif
 
 	dbb->freePage (pageNumber);
@@ -162,6 +162,7 @@ void PageInventoryPage::markPageInUse(Db
 	BDB_HISTORY(bdb);
 	PageInventoryPage *page = (PageInventoryPage*) bdb->buffer;
 	bdb->mark(transId);
+
 	page->freePages [n / PIP_BITS] &= ~MASK (n % PIP_BITS);
 	bdb->release(REL_HISTORY);
 }
@@ -396,7 +397,7 @@ void PageInventoryPage::reallocPage(Dbb 
 {
 #ifdef STOP_PAGE
 	if (pageNumber == STOP_PAGE)
-		Log::debug("page %d/%d reallocated\n", pageNumber, dbb->tableSpaceId);
+		Log::log(LogPageTracing, "page %d/%d reallocated\n", pageNumber, dbb->tableSpaceId);
 #endif
 
 	int32 pip = pageNumber / dbb->pagesPerPip;

=== modified file 'storage/falcon/SRLCheckpoint.cpp'
--- a/storage/falcon/SRLCheckpoint.cpp	2007-10-25 18:10:34 +0000
+++ b/storage/falcon/SRLCheckpoint.cpp	2008-10-24 20:34:05 +0000
@@ -56,6 +56,7 @@ void SRLCheckpoint::read()
 void SRLCheckpoint::pass1()
 {
 	control->haveCheckpoint(blockNumber);
+	print();
 }
 
 void SRLCheckpoint::redo()

=== modified file 'storage/falcon/Section.cpp'
--- a/storage/falcon/Section.cpp	2008-06-17 17:41:54 +0000
+++ b/storage/falcon/Section.cpp	2008-10-24 20:34:05 +0000
@@ -43,7 +43,7 @@
 #include "SQLError.h"
 #include "Table.h"
 
-//#define STOP_PAGE	114
+#define STOP_PAGE	22921
 //#define STOP_SECTION	40
 
 #ifdef STOP_SECTION

=== modified file 'storage/falcon/SerialLog.cpp'
--- a/storage/falcon/SerialLog.cpp	2008-10-14 13:00:31 +0000
+++ b/storage/falcon/SerialLog.cpp	2008-10-24 20:34:05 +0000
@@ -50,7 +50,7 @@
 static const char THIS_FILE[]=__FILE__;
 #endif
 
-static const int TRACE_PAGE = 0;
+static const int TRACE_PAGE = 22921;
 
 extern uint falcon_gopher_threads;
 extern uint64 falcon_serial_log_file_size;
@@ -416,6 +416,7 @@ void SerialLog::recover()
 		}
 		
 	Log::log("Recovery complete\n");
+
 	recoveryPhase = 0;	// Find last lock and recovery block
 }
 

=== modified file 'storage/falcon/Transaction.cpp'
--- a/storage/falcon/Transaction.cpp	2008-10-16 02:53:35 +0000
+++ b/storage/falcon/Transaction.cpp	2008-10-24 20:34:05 +0000
@@ -603,10 +603,10 @@ void Transaction::addRecord(RecordVersio
 	totalRecordData += record->getEncodedSize();
 	++totalRecords;
 	
-	if (totalRecordData > database->configuration->recordChillThreshold)
+	// Chill all records except the current record, which may be part of an update or insert
+//	if (totalRecordData > database->configuration->recordChillThreshold)	
+	if (totalRecords > 1 && totalRecordData > database->configuration->recordChillThreshold)
 		{
-		// Chill all records except the current record, which may be part of an update or insert
-
 		UCHAR saveState = record->state;
 		
 		if (record->state != recLock && record->state != recChilled)

=== modified file 'storage/falcon/Validation.cpp'
--- a/storage/falcon/Validation.cpp	2008-04-09 01:36:46 +0000
+++ b/storage/falcon/Validation.cpp	2008-10-24 20:34:05 +0000
@@ -26,7 +26,7 @@
 #include "Log.h"
 #include "Connection.h"
 
-//#define STOP_PAGE		2896
+#define STOP_PAGE		22921
 
 
 
@@ -120,7 +120,7 @@ bool Validation::isPageType(Bdb *bdb, Pa
 {
 #ifdef STOP_PAGE
 	if (bdb->pageNumber == STOP_PAGE)
-		Log::debug (" validating page %d\n", bdb->pageNumber);
+		Log::log(LogPageTracing, " validating page %d\n", bdb->pageNumber);
 #endif
 
 	if (bdb->pageNumber > highPage)

Thread
bzr commit into mysql-6.0-falcon-team branch (ann:2778) Ann Harrison24 Oct