List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:July 16 2007 5:41pm
Subject:bk commit into 6.0-falcon tree (jas:1.2637)
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-07-16 11:41:13-04:00, jas@rowvwade. +4 -0
  Elminate unnecessary synchronization.

  storage/falcon/Connection.cpp@stripped, 2007-07-16 11:41:03-04:00, jas@rowvwade. +10 -7
    Don't get lock dur Connetion::transactionEnded unless
    there is actually something to clean up.

  storage/falcon/StorageHandler.cpp@stripped, 2007-07-16 11:41:04-04:00, jas@rowvwade. +9 -2
    Don't bugcheck if a Falcon debug server can't be started.

  storage/falcon/ha_falcon.cpp@stripped, 2007-07-16 11:41:04-04:00, jas@rowvwade. +42 -6
    Reduce unnnecessary locking now that there is only one
    database connection per MySQL thread.

  storage/falcon/ha_falcon.h@stripped, 2007-07-16 11:41:05-04:00, jas@rowvwade. +2 -0
    Reduce unnnecessary locking now that there is only one
    database connection per MySQL thread.

# 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.41/storage/falcon/StorageHandler.cpp	2007-07-16 11:41:34 -04:00
+++ 1.42/storage/falcon/StorageHandler.cpp	2007-07-16 11:41:34 -04:00
@@ -121,7 +121,14 @@
 
 void StorageHandler::startNfsServer(void)
 {
-	startServer(0, NULL);
+	try
+		{
+		startServer(0, NULL);
+		}
+	catch (SQLException& exception)
+		{
+		Log::log("Can't start debug server: %s\n", exception.getText());
+		}
 }
 
 void StorageHandler::addNfsLogger(int mask, Logger listener, void* arg)
@@ -244,7 +251,7 @@
 	for (StorageConnection *connection = connections[slot]; connection; connection =
connection->collision)
 		if (connection->mySqlThread == mySqlThread)
 			{
-			int ret =connection->rollback();
+			int ret = connection->rollback();
 			
 			if (ret)
 				return ret;

--- 1.17/storage/falcon/Connection.cpp	2007-07-16 11:41:34 -04:00
+++ 1.18/storage/falcon/Connection.cpp	2007-07-16 11:41:34 -04:00
@@ -285,14 +285,17 @@
 
 void Connection::transactionEnded()
 {
-	Sync sync (&syncResultSets, "Connection::transactionEnded");
-	sync.lock (Shared);
+	if (resultSets || statements)
+		{
+		Sync sync (&syncResultSets, "Connection::transactionEnded");
+		sync.lock (Shared);
 
-	for (ResultSet *resultSet = resultSets; resultSet; resultSet =
resultSet->connectionNext)
-		resultSet->transactionEnded();
-	
-	for (Statement *statement = statements; statement; statement =
statement->connectionNext)
-		statement->transactionEnded();
+		for (ResultSet *resultSet = resultSets; resultSet; resultSet =
resultSet->connectionNext)
+			resultSet->transactionEnded();
+		
+		for (Statement *statement = statements; statement; statement =
statement->connectionNext)
+			statement->transactionEnded();
+		}
 }
 
 void Connection::prepare(int xidSize, const UCHAR *xid)

--- 1.201/storage/falcon/ha_falcon.cpp	2007-07-16 11:41:34 -04:00
+++ 1.202/storage/falcon/ha_falcon.cpp	2007-07-16 11:41:34 -04:00
@@ -458,6 +458,12 @@
 	DBUG_RETURN(0);
 }
 
+
+StorageConnection* StorageInterface::getStorageConnection(THD* thd)
+{
+	return *(StorageConnection**) thd_ha_data(thd, falcon_hton);
+}
+
 int StorageInterface::close(void)
 {
   DBUG_ENTER("StorageInterface::close");
@@ -647,6 +653,7 @@
 		
 	storageShare = storageHandler->createTable(mySqlName, info->tablespace,
tempTable);
 	storageConnection = storageHandler->getStorageConnection(storageShare, mySqlThread,
mySqlThread->thread_id, openOption, falcon_tablespace_mode);
+	*((StorageConnection**) thd_ha_data(mySqlThread, falcon_hton)) = storageConnection;
 	
 	if (!storageConnection)
 		DBUG_RETURN(HA_ERR_NO_CONNECTION);
@@ -983,11 +990,22 @@
 int StorageInterface::commit(handlerton *hton, THD* thd, bool all)
 {
 	DBUG_ENTER("StorageInterface::commit");
-
+	StorageConnection *storageConnection = getStorageConnection(thd);
+	
 	if (all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
-		storageHandler->commit(thd);
+		{
+		if (storageConnection)
+			storageConnection->commit();
+		else
+			storageHandler->commit(thd);
+		}
 	else
-		storageHandler->releaseVerb(thd);
+		{
+		if (storageConnection)
+			storageConnection->releaseVerb();
+		else
+			storageHandler->releaseVerb(thd);
+		}
 	
 	DBUG_RETURN(0);
 }
@@ -999,7 +1017,14 @@
 	if (all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
 		storageHandler->prepare(thd, sizeof(thd->transaction.xid), (const unsigned char*)
&thd->transaction.xid);
 	else
-		storageHandler->releaseVerb(thd);
+		{
+		StorageConnection *storageConnection = getStorageConnection(thd);
+		
+		if (storageConnection)
+			storageConnection->releaseVerb();
+		else
+			storageHandler->releaseVerb(thd);
+		}
 	
 	DBUG_RETURN(0);
 }
@@ -1007,11 +1032,22 @@
 int StorageInterface::rollback(handlerton *hton, THD *thd, bool all)
 {
 	DBUG_ENTER("StorageInterface::rollback");
+	StorageConnection *storageConnection = getStorageConnection(thd);
 
 	if (all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
-		storageHandler->rollback(thd);
+		{
+		if (storageConnection)
+			storageConnection->rollback();
+		else
+			storageHandler->rollback(thd);
+		}
 	else
-		storageHandler->rollbackVerb(thd);
+		{
+		if (storageConnection)
+			storageConnection->rollbackVerb();
+		else
+			storageHandler->rollbackVerb(thd);
+		}
 	
 	DBUG_RETURN(0);
 }

--- 1.45/storage/falcon/ha_falcon.h	2007-07-16 11:41:34 -04:00
+++ 1.46/storage/falcon/ha_falcon.h	2007-07-16 11:41:34 -04:00
@@ -105,6 +105,8 @@
 	void			decodeRecord(uchar *buf);
 	void			unlockTable(void);
 
+	static StorageConnection* getStorageConnection(THD* thd);
+	
 	static int		falcon_init(void *p);
 	static int		falcon_deinit(void *p);
 	static int		commit(handlerton *, THD *thd, bool all);
Thread
bk commit into 6.0-falcon tree (jas:1.2637)U-ROWVWADEjas16 Jul