List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:April 16 2007 5:14pm
Subject:bk commit into 5.1-falcon tree (jas:1.2602)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1-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-04-16 13:13:52-04:00, jas@rowvwade. +6 -0
  Purge completed transactions from committed transaction
  list prior to retiring records.

  storage/falcon/Database.cpp@stripped, 2007-04-16 13:13:44-04:00, jas@rowvwade. +1 -0
    Purge completed transactions from committed transaction
    list prior to retiring records.

  storage/falcon/InfoTable.cpp@stripped, 2007-04-16 13:13:44-04:00, jas@rowvwade. +16 -6
    Switch InfoTable to abstract and implementation classes
    as example of proper API.

  storage/falcon/InfoTable.h@stripped, 2007-04-16 13:13:44-04:00, jas@rowvwade. +25 -12
    Switch InfoTable to abstract and implementation classes
    as example of proper API.

  storage/falcon/TransactionManager.cpp@stripped, 2007-04-16 13:13:45-04:00, jas@rowvwade. +25 -0
    Purge completed transactions from committed transaction
    list prior to retiring records.

  storage/falcon/TransactionManager.h@stripped, 2007-04-16 13:13:45-04:00, jas@rowvwade. +6 -6
    Purge completed transactions from committed transaction
    list prior to retiring records.

  storage/falcon/ha_falcon.cpp@stripped, 2007-04-16 13:13:45-04:00, jas@rowvwade. +8 -9
    Switch InfoTable to abstract and implementation classes
    as example of proper API.

# 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.4/storage/falcon/InfoTable.cpp	2007-04-16 13:14:10 -04:00
+++ 1.5/storage/falcon/InfoTable.cpp	2007-04-16 13:14:10 -04:00
@@ -23,7 +23,7 @@
 #include "mysql_priv.h"
 #include "InfoTable.h"
 
-InfoTable::InfoTable(THD *thd, st_table_list *tables, charset_info_st *scs)
+InfoTableImpl::InfoTableImpl(THD *thd, st_table_list *tables, charset_info_st *scs)
 {
 	table = tables->table;
 	mySqlThread = thd;
@@ -31,26 +31,36 @@
 	error = 0;
 }
 
-InfoTable::~InfoTable(void)
+InfoTableImpl::~InfoTableImpl(void)
 {
 }
 
-void InfoTable::putRecord(void)
+void InfoTableImpl::putRecord(void)
 {
 	error = schema_table_store_record(mySqlThread, table);
 }
 
-void InfoTable::putInt(int column, int value)
+void InfoTableImpl::putInt(int column, int value)
 {
 	table->field[column]->store(value, false);
 }
 
-void InfoTable::putString(int column, const char *string)
+void InfoTableImpl::putString(int column, const char *string)
 {
 	table->field[column]->store(string, strlen(string), charSetInfo);
 }
 
-void InfoTable::putInt64(int column, INT64 value)
+void InfoTableImpl::putInt64(int column, INT64 value)
 {
 	table->field[column]->store(value, false);
+}
+
+void InfoTableImpl::putDouble(int column, double value)
+{
+	table->field[column]->store(value);
+}
+
+void InfoTableImpl::putString(int column, unsigned int stringLength, const char *string)
+{
+	table->field[column]->store(string, stringLength, charSetInfo);
 }

--- 1.3/storage/falcon/InfoTable.h	2007-04-16 13:14:10 -04:00
+++ 1.4/storage/falcon/InfoTable.h	2007-04-16 13:14:10 -04:00
@@ -31,18 +31,31 @@
 class InfoTable
 {
 public:
-	InfoTable(THD *thd, st_table_list *tables, charset_info_st *scs);
-	~InfoTable(void);
-	
-	void	putRecord(void);
-	void	putInt(int column, int value);
-	void	putInt64(int column, INT64 value);
-	void	putString(int column, const char *string);
-	
-	int				error;
-	st_table		*table;
-	THD				*mySqlThread;
-	charset_info_st *charSetInfo;
+    virtual void    putRecord(void) = 0;
+    virtual void    putInt(int column, int value) = 0;
+    virtual void    putInt64(int column, INT64 value) = 0;
+    virtual void    putDouble(int column, double value) = 0;
+    virtual void    putString(int column, const char *string) = 0;
+    virtual void    putString(int column, unsigned int stringLength, const char *string) = 0;
+};
+
+class InfoTableImpl : public InfoTable
+{
+public:
+    InfoTableImpl(THD *thd, st_table_list *tables, charset_info_st *scs);
+    ~InfoTableImpl(void);
+    
+    virtual void    putRecord(void);
+    virtual void    putInt(int column, int value);
+    virtual void    putInt64(int column, INT64 value);
+    virtual void    putString(int column, const char *string);
+    virtual void    putString(int column, unsigned int stringLength, const char *string);
+    virtual void    putDouble(int column, double value);
+    
+    int             error;
+    st_table        *table;
+    THD             *mySqlThread;
+    charset_info_st *charSetInfo;
 };
 
 #endif

--- 1.6/storage/falcon/TransactionManager.cpp	2007-04-16 13:14:10 -04:00
+++ 1.7/storage/falcon/TransactionManager.cpp	2007-04-16 13:14:10 -04:00
@@ -230,3 +230,28 @@
 	for (transaction = committedTransactions.first; transaction; transaction = transaction->next)
 		transaction->getInfo(infoTable);
 }
+
+void TransactionManager::purgeTransactions(Transaction *newlyCommitted)
+{
+	Sync syncCommitted(&committedTransactions.syncObject, "Transaction::commit");
+	syncCommitted.lock(Exclusive);
+	
+	if (newlyCommitted)
+		committedTransactions.append(newlyCommitted);
+	
+	// And, while we're at it, check for any fully mature transactions to ditch
+	
+	for (Transaction *transaction, *next = committedTransactions.first; (transaction = next);)
+		{
+		next = transaction->next;
+
+		if ((transaction->state == Committed) && 
+			(transaction->dependencies == 0) && 
+			!transaction->writePending)
+			{
+			transaction->commitRecords();
+			committedTransactions.remove(transaction);
+			transaction->release();
+			}
+		}
+}

--- 1.6/storage/falcon/TransactionManager.h	2007-04-16 13:14:10 -04:00
+++ 1.7/storage/falcon/TransactionManager.h	2007-04-16 13:14:10 -04:00
@@ -35,18 +35,18 @@
 	Transaction*	startTransaction(Connection* connection);
 	void			dropTable(Table* table, Transaction* transaction);
 	bool			hasUncommittedRecords(Table* table, Transaction* transaction);
-	//void			scavengeRecords(int threshold);
+	void			commitByXid(int xidLength, const UCHAR* xid);
+	void			rollbackByXid(int xidLength, const UCHAR* xid);
+	void			print(void);
+	Transaction*	findOldest(void);
+	void			getTransactionInfo(InfoTable* infoTable);
+	void			purgeTransactions(Transaction *newlyCommitted);
 	
 	TransId			transactionSequence;
 	Database		*database;
 	SyncObject		syncObject;
 	Queue<Transaction>	activeTransactions;
 	Queue<Transaction>	committedTransactions;
-	void commitByXid(int xidLength, const UCHAR* xid);
-	void rollbackByXid(int xidLength, const UCHAR* xid);
-	void print(void);
-	Transaction* findOldest(void);
-	void getTransactionInfo(InfoTable* infoTable);
 };
 
 #endif

--- 1.55/storage/falcon/Database.cpp	2007-04-16 13:14:10 -04:00
+++ 1.56/storage/falcon/Database.cpp	2007-04-16 13:14:10 -04:00
@@ -1559,6 +1559,7 @@
 		
 	int threshold = 0;
 	int64 total = 0;
+	transactionManager->purgeTransactions(NULL);
 	TransId oldestActiveTransaction = transactionManager->findOldestActive();
 	int n;
 

--- 1.145/storage/falcon/ha_falcon.cpp	2007-04-16 13:14:10 -04:00
+++ 1.146/storage/falcon/ha_falcon.cpp	2007-04-16 13:14:10 -04:00
@@ -27,7 +27,6 @@
 #include "StorageHandler.h"
 #include "CmdGen.h"
 #include "InfoTable.h"
-//#include "MemMgr.h"
 //#include "TimeTest.h"
 
 typedef longlong	int64;
@@ -2245,7 +2244,7 @@
 //*****************************************************************************
 int NfsPluginHandler::call_fillSystemMemoryDetailTable(THD *thd, TABLE_LIST *tables, COND *cond)
 {
-	InfoTable infoTable(thd, tables, system_charset_info);
+	InfoTableImpl infoTable(thd, tables, system_charset_info);
 	storageHandler->getMemoryDetailInfo(&infoTable);
 	
 	return infoTable.error;
@@ -2288,7 +2287,7 @@
 int NfsPluginHandler::call_fillSystemMemorySummaryTable(THD *thd, TABLE_LIST *tables, COND *cond)
 {
 	//return(pluginHandler->fillSystemMemorySummaryTable(thd, tables, cond));
-	InfoTable infoTable(thd, tables, system_charset_info);
+	InfoTableImpl infoTable(thd, tables, system_charset_info);
 	storageHandler->getMemorySummaryInfo(&infoTable);
 	
 	return infoTable.error;
@@ -2329,7 +2328,7 @@
 
 int NfsPluginHandler::call_fillRecordCacheDetailTable(THD *thd, TABLE_LIST *tables, COND *cond)
 {
-	InfoTable infoTable(thd, tables, system_charset_info);
+	InfoTableImpl infoTable(thd, tables, system_charset_info);
 	storageHandler->getRecordCacheDetailInfo(&infoTable);
 	
 	return infoTable.error;
@@ -2371,7 +2370,7 @@
 
 int NfsPluginHandler::call_fillRecordCacheSummaryTable(THD *thd, TABLE_LIST *tables, COND *cond)
 {
-	InfoTable infoTable(thd, tables, system_charset_info);
+	InfoTableImpl infoTable(thd, tables, system_charset_info);
 	storageHandler->getRecordCacheSummaryInfo(&infoTable);	
 	
 	return infoTable.error;
@@ -2412,7 +2411,7 @@
 
 int NfsPluginHandler::call_fillDatabaseIOTable(THD *thd, TABLE_LIST *tables, COND *cond)
 {
-	InfoTable infoTable(thd, tables, system_charset_info);
+	InfoTableImpl infoTable(thd, tables, system_charset_info);
 	storageHandler->getIOInfo(&infoTable);
 
 	return infoTable.error;
@@ -2454,7 +2453,7 @@
 
 int NfsPluginHandler::callTransactionInfo(THD *thd, TABLE_LIST *tables, COND *cond)
 {
-	InfoTable infoTable(thd, tables, system_charset_info);
+	InfoTableImpl infoTable(thd, tables, system_charset_info);
 	storageHandler->getTransactionInfo(&infoTable);
 
 	return infoTable.error;
@@ -2499,7 +2498,7 @@
 
 int NfsPluginHandler::callSerialLogInfo(THD *thd, TABLE_LIST *tables, COND *cond)
 {
-	InfoTable infoTable(thd, tables, system_charset_info);
+	InfoTableImpl infoTable(thd, tables, system_charset_info);
 	storageHandler->getSerialLogInfo(&infoTable);
 
 	return infoTable.error;
@@ -2540,7 +2539,7 @@
 
 int NfsPluginHandler::callSyncInfo(THD *thd, TABLE_LIST *tables, COND *cond)
 {
-	InfoTable infoTable(thd, tables, system_charset_info);
+	InfoTableImpl infoTable(thd, tables, system_charset_info);
 	storageHandler->getSyncInfo(&infoTable);
 
 	return infoTable.error;
Thread
bk commit into 5.1-falcon tree (jas:1.2602)U-ROWVWADEjas16 Apr