List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:August 20 2007 7:03pm
Subject:bk commit into 6.0-falcon tree (jas:1.2676)
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-08-20 15:03:34-04:00, jas@rowvwade. +6 -0
  Added configuration parameter "falcon_initial_allocation".

  storage/falcon/Debug.cpp@stripped, 2007-08-20 15:03:24-04:00, jas@rowvwade. +17 -0
    Add page write trace logging capability.

  storage/falcon/Debug.h@stripped, 2007-08-20 15:03:25-04:00, jas@rowvwade. +1 -0
    Add page write trace logging capability.

  storage/falcon/IO.cpp@stripped, 2007-08-20 15:03:25-04:00, jas@rowvwade. +60 -8
    Add page write trace logging capability.

  storage/falcon/IOx.h@stripped, 2007-08-20 15:03:25-04:00, jas@rowvwade. +7 -2
    Add page write trace logging capability.

  storage/falcon/StorageHandler.cpp@stripped, 2007-08-20 15:03:26-04:00, jas@rowvwade. +9 -1
    Added configuration parameter "falcon_initial_allocation".

  storage/falcon/ha_falcon.cpp@stripped, 2007-08-20 15:03:26-04:00, jas@rowvwade. +7 -0
    Added configuration parameter "falcon_initial_allocation".

# 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.43/storage/falcon/StorageHandler.cpp	2007-08-20 15:03:57 -04:00
+++ 1.44/storage/falcon/StorageHandler.cpp	2007-08-20 15:03:57 -04:00
@@ -48,11 +48,13 @@
 	int					savepoint;
 	};
 
+extern uint64		falcon_initial_allocation;
+
 static const char *createTempSpace = "upgrade tablespace " TEMPORARY_TABLESPACE " filename '" FALCON_TEMPORARY "'";
 //static const char *dropTempSpace = "drop tablespace " TEMPORARY_TABLESPACE;
 
 static const char *falconSchema [] = {
-	"create tablespace " DEFAULT_TABLESPACE " filename '" FALCON_USER "' allocation 2000000000",
+	//"create tablespace " DEFAULT_TABLESPACE " filename '" FALCON_USER "' allocation 2000000000",
 	createTempSpace,
 	
 	"upgrade table falcon.tablespaces ("
@@ -883,6 +885,12 @@
 			IO::deleteFile(FALCON_TEMPORARY);
 			dictionaryConnection = defaultDatabase->getOpenConnection();
 			Statement *statement = dictionaryConnection->createStatement();
+
+			JString createTableSpace;
+			createTableSpace.Format(
+					"create tablespace " DEFAULT_TABLESPACE " filename '" FALCON_USER "' allocation " I64FORMAT,
+					falcon_initial_allocation);
+			statement->executeUpdate(createTableSpace);
 			
 			for (const char **ddl = falconSchema; *ddl; ++ddl)
 				statement->executeUpdate(*ddl);

--- 1.5/storage/falcon/Debug.cpp	2007-08-20 15:03:57 -04:00
+++ 1.6/storage/falcon/Debug.cpp	2007-08-20 15:03:57 -04:00
@@ -23,6 +23,7 @@
 #include "Engine.h"
 #include "Debug.h"
 #include "IndexPage.h"
+#include "SectionPage.h"
 #include "Dbb.h"
 #include "BDB.h"
 #include "InversionPage.h"
@@ -30,6 +31,7 @@
 #include "Log.h"
 #include "SQLError.h"
 #include "Database.h"
+#include "RecordLocatorPage.h"
 
 #define WHITE(c)		(c == ' ' || c == '\n')
 
@@ -244,4 +246,19 @@
 void Debug::breakpoint()
 {
 
+}
+
+int Debug::getPageId(Page* page)
+{
+	switch (page->pageType)
+		{
+		case PAGE_sections:
+			return ((SectionPage*) page)->section;
+
+		case PAGE_record_locator:
+			return ((RecordLocatorPage*) page)->section;
+
+		default:
+			return 0;
+		}
 }

--- 1.4/storage/falcon/Debug.h	2007-08-20 15:03:57 -04:00
+++ 1.5/storage/falcon/Debug.h	2007-08-20 15:03:57 -04:00
@@ -58,6 +58,7 @@
 	Page		*page;
 	Dbb			*dbb;
 	Bdb			*bdb;
+	static int getPageId(Page* page);
 };
 
 #endif // !defined(AFX_DEBUG_H__75152282_97E6_48BE_A7B9_B63D67D33867__INCLUDED_)

--- 1.17/storage/falcon/IO.cpp	2007-08-20 15:03:57 -04:00
+++ 1.18/storage/falcon/IO.cpp	2007-08-20 15:03:57 -04:00
@@ -76,7 +76,14 @@
 #include "SQLError.h"
 #include "Sync.h"
 #include "Log.h"
+#include "Debug.h"
 
+#define TRACE_FILE	"falcon.trace"
+
+static const int TRACE_SYNC_START	= -1;
+static const int TRACE_SYNC_END		= -2;
+
+static FILE	*traceFile;
 
 #ifdef _DEBUG
 #undef THIS_FILE
@@ -94,12 +101,15 @@
 	priorReads = priorWrites = priorFetches = priorFakes = 0;
 	dbb = NULL;
 	fatalError = false;
-	//active = true;
-	//highWater = 0;
+
+#ifdef TRACE_FILE
+	traceOpen();
+#endif
 }
 
 IO::~IO()
 {
+	traceClose();
 	closeFile();
 }
 
@@ -164,6 +174,7 @@
 			remaining -= n;
 			}
 		
+		delete [] raw;
 		sync();
 		}
 
@@ -347,7 +358,7 @@
 	deleteFile(fileName);
 }
 
-int IO::pread(int64 offset, int64 length, UCHAR* buffer)
+int IO::pread(int64 offset, int length, UCHAR* buffer)
 {
     int ret;
     Sync sync (&syncObject, "IO::pread");
@@ -357,10 +368,10 @@
     ret = ::pread (fileId, buffer, length, offset);
 #else
     sync.lock (Exclusive);
-
     longSeek(offset);
-    ret = read (length, buffer);
+    ret = (int) read(length, buffer);
 #endif
+
     return ret;
 }
 
@@ -377,18 +388,18 @@
 					   offset, (const char*) fileName, strerror (errno), errno);
 }
 
-int IO::pwrite(int64 offset, int64 length, const UCHAR* buffer)
+int IO::pwrite(int64 offset, int length, const UCHAR* buffer)
 {
     int ret;
 	Sync sync (&syncObject, "IO::pwrite");
+	
 #if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD)
 	sync.lock (Shared);
 	ret = ::pwrite (fileId, buffer, length, offset);
 #else
 	sync.lock (Exclusive);
-
 	longSeek(offset);
-	ret = ::write (fileId, buffer, length);
+	ret = (int) ::write (fileId, buffer, length);
 #endif
 
     return ret;
@@ -405,6 +416,9 @@
 
 void IO::sync(void)
 {
+	if (traceFile)
+		traceOperation(TRACE_SYNC_START);
+		
 #ifdef _WIN32
 	if (_commit(fileId))
 		{
@@ -418,9 +432,47 @@
     sync.lock(Exclusive);
 	fsync(fileId);
 #endif
+
+	if (traceFile)
+		traceOperation(TRACE_SYNC_END);
 }
 
 void IO::deleteFile(const char* fileName)
 {
 	unlink(fileName);
+}
+
+void IO::tracePage(Bdb* bdb)
+{
+	Page *page = bdb->buffer;
+	int id = Debug::getPageId(page);
+	trace(fileId, bdb->pageNumber, page->pageType, id);
+}
+
+void IO::trace(int fd, int pageNumber, int pageType, int pageId)
+{
+	if (traceFile)
+		fprintf(traceFile, "%d %d %d %d\n", fd, pageNumber, pageType, pageId);
+}
+
+void IO::traceOpen(void)
+{
+#ifdef TRACE_FILE
+	if (!traceFile)
+		traceFile = fopen(TRACE_FILE, "w");
+#endif
+}
+
+void IO::traceClose(void)
+{
+	if (traceFile)
+		{
+		fclose(traceFile);
+		traceFile = NULL;
+		}
+}
+
+void IO::traceOperation(int operation)
+{
+	trace(fileId, operation, 0, 0);
 }

--- 1.12/storage/falcon/IOx.h	2007-08-20 15:03:57 -04:00
+++ 1.13/storage/falcon/IOx.h	2007-08-20 15:03:57 -04:00
@@ -55,10 +55,15 @@
 	void	longSeek(int64 offset);
 	void	read(int64 offset, int length, UCHAR* buffer);
 	void	write(int64 offset, int length, const UCHAR* buffer);
-    int     pread(int64 offset, int64 length, UCHAR* buffer);
-    int     pwrite(int64 offset, int64 length, const UCHAR* buffer);
+    int     pread(int64 offset, int length, UCHAR* buffer);
+    int     pwrite(int64 offset, int length, const UCHAR* buffer);
 	void	sync(void);
 
+	void			tracePage(Bdb* bdb);
+	void			traceOperation(int operation);
+	static void		trace(int fd, int pageNumber, int pageType, int pageId);
+	static void		traceOpen(void);
+	static void		traceClose(void);
 	
 	static void		createPath (const char *fileName);
 	static void		expandFileName (const char *fileName, int length, char *buffer);

--- 1.205/storage/falcon/ha_falcon.cpp	2007-08-20 15:03:57 -04:00
+++ 1.206/storage/falcon/ha_falcon.cpp	2007-08-20 15:03:57 -04:00
@@ -82,6 +82,7 @@
 uint					falcon_record_chill_threshold;
 uint					falcon_tablespace_mode;
 uint					falcon_max_transaction_backlog;
+unsigned long long		falcon_initial_allocation;
 
 static struct st_mysql_show_var falconStatus[]=
 {
@@ -2809,6 +2810,11 @@
   "The target amount of active record memory after record scavenging.",
   NULL, NULL, 0, 0, (ulonglong) ~0, LL(1)<<20);
 
+static MYSQL_SYSVAR_ULONGLONG(initial_allocation, falcon_initial_allocation,
+  PLUGIN_VAR_RQCMDARG, // | PLUGIN_VAR_READONLY,
+  "Initial allocation (in bytes) of falcon user tablespace.",
+  NULL, NULL, 0, 0, LL(4000000000), LL(1)<<20);
+
 static MYSQL_SYSVAR_ULONGLONG(page_cache_size, falcon_page_cache_size,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "The amount of memory to be used for the database page cache.",
@@ -2852,6 +2858,7 @@
 	MYSQL_SYSVAR(debug_mask),
 	MYSQL_SYSVAR(max_record_memory),
 	MYSQL_SYSVAR(min_record_memory),
+	MYSQL_SYSVAR(initial_allocation),
 	MYSQL_SYSVAR(page_cache_size),
 	MYSQL_SYSVAR(page_size),
 	MYSQL_SYSVAR(serial_log_buffers),
Thread
bk commit into 6.0-falcon tree (jas:1.2676)U-ROWVWADEjas20 Aug