List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:May 16 2007 2:59pm
Subject:bk commit into 6.0-falcon tree (jas:1.2525)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0-falcon 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-05-16 10:59:37-04:00, jas@rowvwade. +11 -0
  Added new mechanism to manage multi-line log sequences.

  storage/falcon/CMakeLists.txt@stripped, 2007-05-16 10:59:25-04:00, jas@rowvwade. +2 -0
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/Index2Page.cpp@stripped, 2007-05-16 10:59:25-04:00, jas@rowvwade. +2 -2
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/Index2RootPage.cpp@stripped, 2007-05-16 10:59:26-04:00, jas@rowvwade. +4 -6
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/IndexPage.cpp@stripped, 2007-05-16 10:59:26-04:00, jas@rowvwade. +2 -2
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/IndexRootPage.cpp@stripped, 2007-05-16 10:59:26-04:00, jas@rowvwade. +4 -6
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/Log.cpp@stripped, 2007-05-16 10:59:27-04:00, jas@rowvwade. +27 -12
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/Log.h@stripped, 2007-05-16 10:59:27-04:00, jas@rowvwade. +7 -2
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/SQLError.cpp@stripped, 2007-05-16 10:59:28-04:00, jas@rowvwade. +4 -2
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/SyncObject.cpp@stripped, 2007-05-16 10:59:28-04:00, jas@rowvwade. +2 -8
    Added class LogLock to manage log locking for multi-line log
    sequences.

  storage/falcon/Thread.cpp@stripped, 2007-05-16 10:59:29-04:00, jas@rowvwade. +0 -16
    Ripped out old thread saveState/restoreState because it
    didn't work.  Enough said?

  storage/falcon/Thread.h@stripped, 2007-05-16 10:59:29-04:00, jas@rowvwade. +0 -11
    Ripped out old thread saveState/restoreState because it
    didn't work.  Enough said?

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jas
# Host:	rowvwade.
# Root:	D:/MySQL/mysql-5.1-falcon

--- 1.14/storage/falcon/Index2Page.cpp	2007-05-16 10:59:58 -04:00
+++ 1.15/storage/falcon/Index2Page.cpp	2007-05-16 10:59:58 -04:00
@@ -28,6 +28,7 @@
 #include "InversionPage.h"
 #include "Index2Node.h"
 #include "Log.h"
+#include "LogLock.h"
 #include "Debug.h"
 #include "IndexKey.h"
 #include "SerialLog.h"
@@ -541,8 +542,7 @@
 
 void Index2Page::printPage(Index2Page * page, int32 pageNumber, bool inversion)
 {
-	Sync sync(&Log::syncObject, "Index2Page::printPage");
-	sync.lock(Exclusive);
+	LogLock logLock;
 	UCHAR	key [MAX_PHYSICAL_KEY_LENGTH];
 	int		length;
 

--- 1.14/storage/falcon/Index2RootPage.cpp	2007-05-16 10:59:58 -04:00
+++ 1.15/storage/falcon/Index2RootPage.cpp	2007-05-16 10:59:58 -04:00
@@ -30,6 +30,7 @@
 #include "Index2Node.h"
 #include "SQLError.h"
 #include "Log.h"
+#include "LogLock.h"
 #include "IndexKey.h"
 #include "SerialLogControl.h"
 #include "Transaction.h"
@@ -111,8 +112,7 @@
 	
 	if (dbb->debug & (DEBUG_KEYS | DEBUG_NODES_ADDED))
 		{
-		Sync sync(&Log::syncObject, "Index2RootPage::addIndexEntry");
-		sync.lock(Exclusive);
+		LogLock logLock;
 		Btn::printKey ("insertion key: ", key, 0, false);
 		}
 		
@@ -327,8 +327,7 @@
 
 	if (dbb->debug & (DEBUG_KEYS | DEBUG_SCAN_INDEX))
 		{
-		Sync sync(&Log::syncObject, "Index2RootPage::scanIndex");
-		sync.lock(Exclusive);
+		LogLock logLock;
 		Btn::printKey ("lower: ", lowKey, 0, false);
 		Btn::printKey ("upper: ", highKey, 0, false);
 		}
@@ -836,8 +835,7 @@
 			
 		if (dbb->debug & (DEBUG_KEYS | DEBUG_NODES_DELETED))
 			{
-			Sync sync(&Log::syncObject, "Index2RootPage::indexMerge");
-			sync.lock(Exclusive);
+			LogLock logLock;
 			Btn::printKey ("insertion key: ", &key, 0, false);
 			}
 		

--- 1.45/storage/falcon/CMakeLists.txt	2007-05-16 10:59:58 -04:00
+++ 1.46/storage/falcon/CMakeLists.txt	2007-05-16 10:59:58 -04:00
@@ -112,6 +112,7 @@
 		JString.cpp
 		LinkedList.cpp 
 		Log.cpp
+		LogLock.cpp
 		LogStream.cpp 
 		MACAddress.cpp
 		MemMgr.cpp 
@@ -364,6 +365,7 @@
 		JString.h
 		LinkedList.h 
 		Log.h
+		LogLock.h
 		LogStream.h 
 		MACAddress.h
 		MemMgr.h 

--- 1.49/storage/falcon/IndexPage.cpp	2007-05-16 10:59:58 -04:00
+++ 1.50/storage/falcon/IndexPage.cpp	2007-05-16 10:59:58 -04:00
@@ -28,6 +28,7 @@
 #include "InversionPage.h"
 #include "IndexNode.h"
 #include "Log.h"
+#include "LogLock.h"
 #include "Debug.h"
 #include "IndexKey.h"
 #include "SerialLog.h"
@@ -572,8 +573,7 @@
 
 void IndexPage::printPage(IndexPage * page, int32 pageNumber, bool inversion)
 {
-	Sync sync(&Log::syncObject, "IndexPage::printPage");
-	sync.lock(Exclusive);
+	LogLock logLock;
 	UCHAR	key [MAX_PHYSICAL_KEY_LENGTH];
 	int		length;
 

--- 1.62/storage/falcon/IndexRootPage.cpp	2007-05-16 10:59:58 -04:00
+++ 1.63/storage/falcon/IndexRootPage.cpp	2007-05-16 10:59:58 -04:00
@@ -30,6 +30,7 @@
 #include "IndexNode.h"
 #include "SQLError.h"
 #include "Log.h"
+#include "LogLock.h"
 #include "IndexKey.h"
 #include "SerialLogControl.h"
 #include "Transaction.h"
@@ -112,8 +113,7 @@
 	
 	if (dbb->debug & (DEBUG_KEYS | DEBUG_NODES_ADDED))
 		{
-		Sync sync(&Log::syncObject, "IndexRootPage::addIndexEntry");
-		sync.lock(Exclusive);
+		LogLock logLock;
 		Btn::printKey ("insertion key: ", key, 0, false);
 		Btn::printKey (" appended key: ", &searchKey, 0, false);
 		}
@@ -345,8 +345,7 @@
 
 	if (dbb->debug & (DEBUG_KEYS | DEBUG_SCAN_INDEX))
 		{
-		Sync sync(&Log::syncObject, "IndexRootPage::scanIndex");
-		sync.lock(Exclusive);
+		LogLock logLock;
 		Btn::printKey ("lower: ", lowKey, 0, false);
 		Btn::printKey ("upper: ", highKey, 0, false);
 		}
@@ -862,8 +861,7 @@
 			
 		if (dbb->debug & (DEBUG_KEYS | DEBUG_NODES_DELETED))
 			{
-			Sync sync(&Log::syncObject, "IndexRootPage::indexMerge");
-			sync.lock(Exclusive);
+			LogLock logLock;
 			Btn::printKey ("insertion key: ", &key, 0, false);
 			Btn::printKey (" appended key: ", &searchKey, 0, false);
 			}

--- 1.9/storage/falcon/Log.cpp	2007-05-16 10:59:58 -04:00
+++ 1.10/storage/falcon/Log.cpp	2007-05-16 10:59:58 -04:00
@@ -60,9 +60,8 @@
 
 static LogListener		*listeners;
 static SymbolManager	*symbols;
-
-SyncObject		Log::syncObject;
-
+int						Log::exclusive;
+Thread*					Log::exclusiveThread;
 
 static bool		initialize();
 static bool		initialized = initialize ();
@@ -190,12 +189,9 @@
 
 void Log::logMessage(int mask, const char *text)
 {
-	Thread *thread = Thread::getThread("Log::logMessage");
-	ThreadState threadState;
-	thread->saveState(&threadState);
-
-	Sync sync(&syncObject, "Log::logMessage");
-	sync.lock(Exclusive);
+	//Thread *thread = Thread::getThread("Log::logMessage");
+	//Sync sync(&syncObject, "Log::logMessage");
+	//sync.lock(Exclusive);
 	char temp [1024], *scrubbed = temp;
 
 	if ((mask & LogScrub) && symbols)
@@ -244,7 +240,8 @@
 		text = scrubbed;
 		}
 
-	ENTER_CRITICAL_SECTION;
+	if (!exclusive)
+		ENTER_CRITICAL_SECTION;
 
 	try
 		{
@@ -277,8 +274,8 @@
 		}
 	
 
-	LEAVE_CRITICAL_SECTION;
-	thread->restoreState(&threadState);
+	if (!exclusive)
+		LEAVE_CRITICAL_SECTION;
 	
 	if (scrubbed != temp)
 		delete [] scrubbed;
@@ -329,4 +326,22 @@
 		else
 			*q++ = c;
 		}
+}
+
+void Log::setExclusive(void)
+{
+	Thread *thread = Thread::getThread("Log::setExclusive");
+	
+	if (thread != exclusiveThread)
+		ENTER_CRITICAL_SECTION;
+	
+	++exclusive;
+}
+
+void Log::releaseExclusive(void)
+{
+	ASSERT(exclusive);
+	
+	if (--exclusive == 0)
+		LEAVE_CRITICAL_SECTION;
 }

--- 1.5/storage/falcon/Log.h	2007-05-16 10:59:58 -04:00
+++ 1.6/storage/falcon/Log.h	2007-05-16 10:59:58 -04:00
@@ -47,6 +47,8 @@
 	LogListener	*next;
 	};
 
+class Thread;
+
 class Log  
 {
 public:
@@ -63,8 +65,11 @@
 	static void print (int mask, const char *text, void *arg);
 	static void debug (const char *txt, ...);
 	static void log (const char *txt, ...);
-	
-	static SyncObject	syncObject;
+	static void setExclusive(void);
+	static void releaseExclusive(void);
+
+	static int		exclusive;
+	static Thread	*exclusiveThread;
 };
 
 #endif // !defined(AFX_LOG_H__C0B6CEB0_9A4F_11D5_B8D6_00E0180AC49E__INCLUDED_)

--- 1.7/storage/falcon/SQLError.cpp	2007-05-16 10:59:58 -04:00
+++ 1.8/storage/falcon/SQLError.cpp	2007-05-16 10:59:58 -04:00
@@ -28,6 +28,7 @@
 #include "SQLError.h"
 #include "Stream.h"
 #include "Log.h"
+#include "LogLock.h"
 #include "Sync.h"
 
 #ifdef _WIN32
@@ -180,8 +181,9 @@
 void SQLError::error(const char *string)
 {
 #ifdef ENGINE
-	Sync sync(&Log::syncObject, "SQLError::error");
-	sync.lock(Exclusive);
+	LogLock logLock;
+	//Sync sync(&Log::syncObject, "SQLError::error");
+	//sync.lock(Exclusive);
 	Log::log(LogException, "Exception: %s\n", string);
 #endif
 }

--- 1.25/storage/falcon/SyncObject.cpp	2007-05-16 10:59:58 -04:00
+++ 1.26/storage/falcon/SyncObject.cpp	2007-05-16 10:59:58 -04:00
@@ -41,6 +41,7 @@
 #include "Interlock.h"
 #include "LinkedList.h"
 #include "Log.h"
+#include "LogLock.h"
 #include "SQLError.h"
 #include "Stream.h"
 #include "InfoTable.h"
@@ -345,12 +346,7 @@
 {
 #ifdef TRACE
 	mutex.lock();
-	ThreadState threadState;
-	thread->saveState(&threadState);
-	
-	Sync sync(&Log::syncObject, "SyncObject::stalled");
-	sync.lock(Exclusive);
-	
+	LogLock logLock;
 	LinkedList threads;
 	LinkedList syncObjects;
 	thread->findLocks (threads, syncObjects);
@@ -368,9 +364,7 @@
 	END_FOR;
 
 	LOG_DEBUG ("------------------------------------\n");
-	thread->restoreState(&threadState);
 	mutex.release();
-
 #endif
 }
 

--- 1.21/storage/falcon/Thread.cpp	2007-05-16 10:59:58 -04:00
+++ 1.22/storage/falcon/Thread.cpp	2007-05-16 10:59:58 -04:00
@@ -513,19 +513,3 @@
 {
 	exitMutex.unlock();
 }
-
-void Thread::saveState(ThreadState* state)
-{
-	state->threadQue = que;
-	state->lockType = lockType;
-	state->lockGranted = lockGranted;
-	state->lockPending = lockPending;
-}
-
-void Thread::restoreState(ThreadState* state)
-{
-	que = state->threadQue;
-	lockType = state->lockType;
-	lockGranted = state->lockGranted;
-	lockPending = state->lockPending;
-}

--- 1.11/storage/falcon/Thread.h	2007-05-16 10:59:58 -04:00
+++ 1.12/storage/falcon/Thread.h	2007-05-16 10:59:58 -04:00
@@ -40,15 +40,6 @@
 #include "Synchronize.h"
 #include "SynchronizationObject.h"
 
-class Thread;
-
-struct ThreadState 
-	{
-	Thread		*threadQue;
-	Sync		*lockPending;
-	LockType	lockType;
-	bool		lockGranted;
-	};
 
 class Threads;
 class Sync;
@@ -83,8 +74,6 @@
 	void			start (const char *desc, void (*fn)(void*), void*arg);
 	void			thread();
 	void			setThreadBarn (Threads *newBarn);
-	void			saveState(ThreadState* state);
-	void			restoreState(ThreadState* state);
 
 	static THREAD_RET _stdcall thread (void* parameter);
 	static void		deleteThreadObject();
Thread
bk commit into 6.0-falcon tree (jas:1.2525)U-ROWVWADEjas16 May