List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:October 5 2007 1:51pm
Subject:bk commit into 6.0 tree (jas:1.2622)
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-10-05 09:51:40-04:00, jas@rowvwade. +8 -0
  Working towards bifurcating blob updates to the serial log
  (smallish blobs) and "early write" (biggish blobs).

  storage/falcon/Database.cpp@stripped, 2007-10-05 09:51:30-04:00, jas@rowvwade. +4 -1
    Add mechanism to freeze Falcon at all internal blocking site
    for debug analysis.

  storage/falcon/Database.h@stripped, 2007-10-05 09:51:31-04:00, jas@rowvwade. +1 -0
    Add mechanism to freeze Falcon at all internal blocking site
    for debug analysis.

  storage/falcon/Dbb.cpp@stripped, 2007-10-05 09:51:31-04:00, jas@rowvwade. +9 -6
    Working towards bifurcating blob updates to the serial log
    (smallish blobs) and "early write" (biggish blobs).

  storage/falcon/Dbb.h@stripped, 2007-10-05 09:51:31-04:00, jas@rowvwade. +2 -3
    Working towards bifurcating blob updates to the serial log
    (smallish blobs) and "early write" (biggish blobs).

  storage/falcon/SerialLog.cpp@stripped, 2007-10-05 09:51:32-04:00, jas@rowvwade. +1 -1
    Commented out relatively expensive assertion.

  storage/falcon/Synchronize.cpp@stripped, 2007-10-05 09:51:32-04:00, jas@rowvwade. +24 -8
    Working towards bifurcating blob updates to the serial log
    (smallish blobs) and "early write" (biggish blobs).

  storage/falcon/Synchronize.h@stripped, 2007-10-05 09:51:32-04:00, jas@rowvwade. +11 -0
    Working towards bifurcating blob updates to the serial log
    (smallish blobs) and "early write" (biggish blobs).

  storage/falcon/Table.cpp@stripped, 2007-10-05 09:51:33-04:00, jas@rowvwade. +7 -4
    Streamlined blob path.

diff -Nrup a/storage/falcon/Database.cpp b/storage/falcon/Database.cpp
--- a/storage/falcon/Database.cpp	2007-10-04 14:08:31 -04:00
+++ b/storage/falcon/Database.cpp	2007-10-05 09:51:30 -04:00
@@ -2294,6 +2294,9 @@ void Database::debugTrace(void)
 	
 	if (falcon_debug_trace & FALC0N_SYNC_OBJECTS)
 		SyncObject::dump();
-				
+	
+	if (falcon_debug_trace & FALC0N_FREEZE)
+		Synchronize::freezeSystem();
+	
 	falcon_debug_trace = 0;
 }
diff -Nrup a/storage/falcon/Database.h b/storage/falcon/Database.h
--- a/storage/falcon/Database.h	2007-10-04 12:10:09 -04:00
+++ b/storage/falcon/Database.h	2007-10-05 09:51:31 -04:00
@@ -44,6 +44,7 @@
 static const int FALC0N_TRACE_TRANSACTIONS	= 1;
 static const int FALC0N_SYNC_TEST			= 2;
 static const int FALC0N_SYNC_OBJECTS		= 4;
+static const int FALC0N_FREEZE				= 8;
 
 #define TABLE_HASH_SIZE		101
 
diff -Nrup a/storage/falcon/Dbb.cpp b/storage/falcon/Dbb.cpp
--- a/storage/falcon/Dbb.cpp	2007-09-20 11:41:37 -04:00
+++ b/storage/falcon/Dbb.cpp	2007-10-05 09:51:31 -04:00
@@ -308,10 +308,19 @@ void Dbb::logRecord(int32 sectionId, int
 		updateRecord(sectionId, recordId, stream, transaction->transactionId, false);
 }
 
+void Dbb::updateBlob(Section *blobSection, int recordNumber, Stream* stream, Transaction* transaction)
+{
+	//updateBlob(blobSectionId, recordNumber, stream, TRANSACTION_ID(transaction));
+	updateRecord(blobSection, recordNumber, stream, transaction, true);
+	transaction->pendingPageWrites = true;
+}
+
+/***
 void Dbb::updateBlob(int32 sectionId, int32 recordId, Stream *stream, TransId transId)
 {
 	updateRecord(sectionId, recordId, stream, transId, true);
 }
+***/
 
 void Dbb::updateRecord(int32 sectionId, int32 recordId, Stream *stream, TransId transId, bool earlyWrite)
 {
@@ -1347,10 +1356,4 @@ void Dbb::updateTableSpaceSection(int id
 	Hdr *header = (Hdr*) bdb->buffer;
 	header->tableSpaceSectionId = id;
 	bdb->release(REL_HISTORY);
-}
-
-void Dbb::updateBlob(int blobSectionId, int recordNumber, Stream* stream, Transaction* transaction)
-{
-	updateBlob(blobSectionId, recordNumber, stream, TRANSACTION_ID(transaction));
-	transaction->pendingPageWrites = true;
 }
diff -Nrup a/storage/falcon/Dbb.h b/storage/falcon/Dbb.h
--- a/storage/falcon/Dbb.h	2007-09-20 11:41:37 -04:00
+++ b/storage/falcon/Dbb.h	2007-10-05 09:51:31 -04:00
@@ -113,9 +113,8 @@ public:
 	void	createSection(int32 sectionId, TransId transId);
 	void	dropDatabase();
 	void	enableSerialLog();
-	//void	setRecovering(bool flag);
 	void	rollback (TransId transId, bool updateTransaction);
-	void	updateBlob(int32 sectionId, int32 recordId, Stream *stream, TransId transId);
+	//void	updateBlob(int32 sectionId, int32 recordId, Stream *stream, TransId transId);
 	void	updateRecord(int32 sectionId, int32 recordId, Stream *stream, TransId transId, bool earlyWrite);
 	void	prepareTransaction(TransId transId, int xidLength, const UCHAR *xid);
 	void	commit(Transaction *transaction);
@@ -185,7 +184,7 @@ public:
 	void	addShadow(DatabaseCopy* shadow);
 	void	skewHeader(Hdr* header);
 	void	printPage(Bdb* bdb);
-	void	updateBlob(int blobSectionId, int recordNumber, Stream* blob, Transaction* transaction);
+	void	updateBlob(Section *blobSection, int recordNumber, Stream* blob, Transaction* transaction);
 	
 	Cache		*cache;
 	Database	*database;
diff -Nrup a/storage/falcon/SerialLog.cpp b/storage/falcon/SerialLog.cpp
--- a/storage/falcon/SerialLog.cpp	2007-10-04 16:45:27 -04:00
+++ b/storage/falcon/SerialLog.cpp	2007-10-05 09:51:32 -04:00
@@ -1214,7 +1214,7 @@ void SerialLog::putVersion()
 
 void SerialLog::wakeupFlushQueue(Thread *ourThread)
 {
-	ASSERT(syncWrite.getExclusiveThread() == Thread::getThread("SerialLog::wakeupFlushQueue"));
+	//ASSERT(syncWrite.getExclusiveThread() == Thread::getThread("SerialLog::wakeupFlushQueue"));
 	writer = NULL;
 	Thread *thread = srlQueue;
 	
diff -Nrup a/storage/falcon/Synchronize.cpp b/storage/falcon/Synchronize.cpp
--- a/storage/falcon/Synchronize.cpp	2007-09-20 11:42:43 -04:00
+++ b/storage/falcon/Synchronize.cpp	2007-10-05 09:51:32 -04:00
@@ -33,6 +33,7 @@
 
 #include "Engine.h"
 #include "Synchronize.h"
+#include "Interlock.h"
 
 #ifdef ENGINE
 #include "Log.h"
@@ -41,6 +42,10 @@
 #define CHECK_RET(text,code)	
 #endif
 
+#ifdef SYNCHRONIZE_FREEZE
+INTERLOCK_TYPE synchronizeFreeze;
+#endif
+
 #define NANO		1000000000
 #define MICRO		1000000
 
@@ -84,12 +89,17 @@ void Synchronize::sleep()
 	sleeping = true;
 #ifdef _WIN32
 #ifdef _DEBUG
+
 	for (;;)
 		{
 		int n = WaitForSingleObject (event, 10000);
 		sleeping = false;
+		
 		if (n != WAIT_TIMEOUT)
+			{
+			DEBUG_FREEZE;
 			return;
+			}
 		}
 #else
 	sleep (INFINITE);
@@ -108,6 +118,8 @@ void Synchronize::sleep()
 	CHECK_RET ("pthread_mutex_unlock failed, errno %d", errno);
 #endif
 	sleeping = false;
+
+	DEBUG_FREEZE;
 }
 
 bool Synchronize::sleep(int milliseconds)
@@ -117,6 +129,7 @@ bool Synchronize::sleep(int milliseconds
 #ifdef _WIN32
 	int n = WaitForSingleObject(event, milliseconds);
 	sleeping = false;
+	DEBUG_FREEZE;
 
 	return n != WAIT_TIMEOUT;
 #endif
@@ -137,15 +150,7 @@ bool Synchronize::sleep(int milliseconds
 		ret = pthread_cond_timedwait(&condition, &mutex, &nanoTime);
 		
 		if (ret == ETIMEDOUT)
-			{
-			/***
-			struct timeval endTime;
-			gettimeofday (&endTime, NULL);
-			waitTime = ((int64) endTime.tv_sec * MICRO + endTime.tv_usec) -
-					   ((int64) microTime.tv_sec * MICRO + microTime.tv_usec);
-			***/
 			break;
-			}
 			
 		if (!wakeup)
 #ifdef ENGINE
@@ -159,6 +164,7 @@ bool Synchronize::sleep(int milliseconds
 	sleeping = false;
 	wakeup = false;
 	pthread_mutex_unlock(&mutex);
+	DEBUG_FREEZE;
 
 	return ret != ETIMEDOUT;
 #endif
@@ -184,4 +190,14 @@ void Synchronize::shutdown()
 {
 	shutdownInProgress = true;
 	wake();
+}
+
+void Synchronize::freeze(void)
+{
+	COMPARE_EXCHANGE(&synchronizeFreeze, synchronizeFreeze, 0);
+}
+
+void Synchronize::freezeSystem(void)
+{
+	COMPARE_EXCHANGE(&synchronizeFreeze, 0, true);
 }
diff -Nrup a/storage/falcon/Synchronize.h b/storage/falcon/Synchronize.h
--- a/storage/falcon/Synchronize.h	2007-09-20 11:42:43 -04:00
+++ b/storage/falcon/Synchronize.h	2007-10-05 09:51:32 -04:00
@@ -28,6 +28,15 @@
 #include <pthread.h>
 #endif
 
+#define SYNCHRONIZE_FREEZE
+
+#ifdef SYNCHRONIZE_FREEZE
+#define DEBUG_FREEZE	if (synchronizeFreeze) Synchronize::freeze();
+extern INTERLOCK_TYPE synchronizeFreeze;
+#else
+#define DEBUG_FREEZE
+#endif
+
 #ifdef ENGINE
 #define LOG_DEBUG	Log::debug
 #define DEBUG_BREAK	Log::debugBreak
@@ -59,6 +68,8 @@ public:
 	pthread_cond_t	condition;
 	pthread_mutex_t	mutex;
 #endif
+	static void freeze(void);
+	static void freezeSystem(void);
 };
 
 #endif // !defined(AFX_SYNCHRONIZE_H__9E13C6D8_1F3E_11D3_AB74_0000C01D2301__INCLUDED_)
diff -Nrup a/storage/falcon/Table.cpp b/storage/falcon/Table.cpp
--- a/storage/falcon/Table.cpp	2007-10-04 18:01:20 -04:00
+++ b/storage/falcon/Table.cpp	2007-10-05 09:51:33 -04:00
@@ -958,7 +958,7 @@ int32 Table::getBlobId(Value * value, in
 	Blob *blob = value->getBlob();
 	int32 recordNumber = dbb->insertStub(blobSectionId, transaction);
 	blob->length();
-	dbb->updateBlob(blobSectionId, recordNumber, (BinaryBlob*) blob, transaction);
+	dbb->updateBlob(blobSection, recordNumber, (BinaryBlob*) blob, transaction);
 	blob->release();
 
 	return recordNumber;
@@ -967,6 +967,9 @@ int32 Table::getBlobId(Value * value, in
 
 int32 Table::getIndirectId(BlobReference *reference, Transaction *transaction)
 {
+	if (!blobSection)
+		blobSection = dbb->findSection(blobSectionId);
+
 	const char *repoName = database->getSymbol(reference->repositoryName);
 	Repository *repository = database->getRepository(schemaName, repoName);
 
@@ -976,7 +979,7 @@ int32 Table::getIndirectId(BlobReference
 	Stream refData;
 	reference->getReference(&refData);
 	int32 recordNumber = dbb->insertStub(blobSectionId, transaction);
-	dbb->updateBlob(blobSectionId, recordNumber, &refData, transaction);
+	dbb->updateBlob(blobSection, recordNumber, &refData, transaction);
 
 	return (recordNumber) ? -recordNumber : ZERO_REPOSITORY_PLACE;
 }
@@ -2471,7 +2474,7 @@ void Table::validateBlobs(int optionMask
 			Log::debug ("Orphan blob %d, table %s.%s, blob section %d\n", next, schemaName, name, blobSectionId);
 			
 			if (optionMask & validateRepair)
-				dbb->updateRecord(blobSectionId, next, NULL, NO_TRANSACTION, false);
+				dbb->updateRecord(blobSection, next, NULL, NO_TRANSACTION, false);
 			}
 		}
 
@@ -2888,7 +2891,7 @@ int Table::storeBlob(Transaction *transa
 	int32 recordNumber = dbb->insertStub(blobSection, transaction);
 	Stream stream;
 	stream.putSegment((int) length, (const char*) data, false);
-	dbb->updateBlob(blobSectionId, recordNumber, &stream, transaction);
+	dbb->updateBlob(blobSection, recordNumber, &stream, transaction);
 
 	return recordNumber;
 }
Thread
bk commit into 6.0 tree (jas:1.2622)U-ROWVWADEjas5 Oct