List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:November 5 2007 8:48pm
Subject:bk commit into 6.0 tree (jas:1.2693)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of . When  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, 2007-11-05 14:48:23-05:00, jas@rowvwade. +4 -0
  Add diagnostic code for page consolidation analysis.

  storage/falcon/Cache.cpp@stripped, 2007-11-05 14:48:14-05:00, jas@rowvwade. +73 -0
    Add diagnostic code for page consolidation analysis.

  storage/falcon/Cache.h@stripped, 2007-11-05 14:48:15-05:00, jas@rowvwade. +4 -0
    Add diagnostic code for page consolidation analysis.

  storage/falcon/IO.cpp@stripped, 2007-11-05 14:48:15-05:00, jas@rowvwade. +1 -1
    Change name of trace file.

  storage/falcon/SerialLog.cpp@stripped, 2007-11-05 14:48:15-05:00, jas@rowvwade. +3 -6
    Shut down all gopher threads, not just the first.

diff -Nrup a/storage/falcon/Cache.cpp b/storage/falcon/Cache.cpp
--- a/storage/falcon/Cache.cpp	2007-11-03 01:33:48 -04:00
+++ b/storage/falcon/Cache.cpp	2007-11-05 14:48:14 -05:00
@@ -43,6 +43,9 @@
 extern uint falcon_io_threads;
 
 //#define STOP_PAGE		109
+#define TRACE_FILE	"cache.trace"
+
+static FILE			*traceFile;
 
 static const uint64 cacheHunkSize		= 1024 * 1024 * 128;
 static const int	ASYNC_BUFFER_SIZE	= 1024000;
@@ -58,6 +61,7 @@ static const char THIS_FILE[]=__FILE__;
 
 Cache::Cache(Database *db, int pageSz, int hashSz, int numBuffers)
 {
+	openTraceFile();
 	database = db;
 	panicShutdown = false;
 	pageSize = pageSz;
@@ -130,6 +134,9 @@ Cache::Cache(Database *db, int pageSz, i
 
 Cache::~Cache()
 {
+	if (traceFile)
+		closeTraceFile();
+
 	delete [] hashTable;
 	delete [] bdbs;
 	delete [] ioThreads;
@@ -363,6 +370,9 @@ void Cache::flush(int64 arg)
 		++flushPages;
 		}
 
+	if (traceFile)
+		analyzeFlush();
+
 	flushStart = database->timestamp;
 	flushing = true;
 	sync.unlock();
@@ -1053,4 +1063,67 @@ void Cache::shutdownThreads(void)
 	
 	Sync sync(&syncThreads, "Cache::shutdownThreads");
 	sync.lock(Exclusive);
+}
+
+void Cache::analyzeFlush(void)
+{
+	Dbb *dbb = NULL;
+	Bdb *bdb;
+	
+	for (bdb = firstDirty; bdb; bdb = bdb->nextDirty)
+		if (bdb->dbb->tableSpaceId == 1)
+			{
+			dbb = bdb->dbb;
+			
+			break;
+			}
+	
+	if (!dbb)
+		return;
+	
+	fprintf(traceFile, "-------- time %d -------\n", database->deltaTime);
+
+	for (int pageNumber = 0; (pageNumber = flushBitmap->nextSet(pageNumber)) >= 0;)
+		if ( (bdb = findBdb(dbb, pageNumber)) )
+			{
+			int start = pageNumber;
+			
+			for (; (bdb = findBdb(dbb, ++pageNumber)) && bdb->flushIt;)
+				;
+			
+			fprintf(traceFile, " %d flushed: %d to %d\n", pageNumber - start, start, pageNumber -
1);
+			
+			for (int max = pageNumber + 5; pageNumber < max && (bdb = findBdb(dbb,
pageNumber)) && !bdb->flushIt; ++pageNumber)
+				{
+				if (bdb->flags & BDB_dirty)
+					fprintf(traceFile, " %d dirty not flushed\n", pageNumber);
+				else
+					fprintf(traceFile," %d not dirty\n", pageNumber);
+				}
+			}
+		else
+			++pageNumber;
+	
+	fflush(traceFile);			
+}
+
+void Cache::openTraceFile(void)
+{
+#ifdef TRACE_FILE
+	if (traceFile)
+		closeTraceFile();
+		
+	traceFile = fopen(TRACE_FILE, "w");
+#endif
+}
+
+void Cache::closeTraceFile(void)
+{
+#ifdef TRACE_FILE
+	if (traceFile)
+		{
+		fclose(traceFile);
+		traceFile = NULL;
+		}
+#endif
 }
diff -Nrup a/storage/falcon/Cache.h b/storage/falcon/Cache.h
--- a/storage/falcon/Cache.h	2007-10-27 14:36:57 -04:00
+++ b/storage/falcon/Cache.h	2007-11-05 14:48:15 -05:00
@@ -70,6 +70,10 @@ public:
 	Bdb*	fetchPage (Dbb *dbb, int32 pageNumber, PageType type, LockType lockType);
 	Bdb*	trialFetch(Dbb* dbb, int32 pageNumber, LockType lockType);
 
+	void	analyzeFlush(void);
+	void	openTraceFile(void);
+	void	closeTraceFile(void);
+
 	Cache(Database *db, int pageSize, int hashSize, int numberBuffers);
 	virtual ~Cache();
 
diff -Nrup a/storage/falcon/IO.cpp b/storage/falcon/IO.cpp
--- a/storage/falcon/IO.cpp	2007-11-03 01:33:50 -04:00
+++ b/storage/falcon/IO.cpp	2007-11-05 14:48:15 -05:00
@@ -80,7 +80,7 @@
 #include "Debug.h"
 #include "Synchronize.h"
 
-#define TRACE_FILE	"falcon.trace"
+#define TRACE_FILE	"io.trace"
 
 extern uint		falcon_direct_io;
 
diff -Nrup a/storage/falcon/SerialLog.cpp b/storage/falcon/SerialLog.cpp
--- a/storage/falcon/SerialLog.cpp	2007-11-05 11:03:35 -05:00
+++ b/storage/falcon/SerialLog.cpp	2007-11-05 14:48:15 -05:00
@@ -602,7 +602,9 @@ void SerialLog::createNewWindow(void)
 void SerialLog::shutdown()
 {
 	finishing = true;
-	wakeup();
+	
+	for (Gopher *gopher = gophers; gopher; gopher = gopher->next)
+		gopher->wakeup();
 
 	// Wait for all gopher threads to exit
 	
@@ -613,11 +615,6 @@ void SerialLog::shutdown()
 		unblockUpdates();
 
 	checkpoint(false);
-	
-	/***
-	if (workerThread)
-		workerThread->shutdown();
-	***/
 	
 	for (Gopher *gopher = gophers; gopher; gopher = gopher->next)
 		gopher->shutdown();
Thread
bk commit into 6.0 tree (jas:1.2693)U-ROWVWADEjas5 Nov