List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:February 25 2008 4:03pm
Subject:RE: bk commit into 6.0 tree (vvaintroub:1.2822) BUG#34085
View as plain text  
Kevin, this is a part of cleanup.
If plugin is not loaded, no other function except falcon_init() is called and falcon
variables are not visible.

Vlad
> -----Original Message-----
> From: Kevin Lewis [mailto:klewis@stripped]
> Sent: Monday, February 25, 2008 4:01 PM
> To: vvaintroub@stripped; commits@stripped
> Subject: RE: bk commit into 6.0 tree (vvaintroub:1.2822) BUG#34085
> 
> Vlad,
> 
> Why did you take out
> 
> -	if (storageHandler)
> 
> 3 places in ha_falcon.cpp?
> 
> >-----Original Message-----
> >From: vvaintroub@stripped [mailto:vvaintroub@stripped]
> >Sent: Sunday, February 24, 2008 9:48 AM
> >To: commits@stripped
> >Subject: bk commit into 6.0 tree (vvaintroub:1.2822) BUG#34085
> >
> >Below is the list of changes that have just been committed into a
> local
> >6.0 repository of vvaintroub. When vvaintroub 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, 2008-02-24 16:48:01+01:00, vvaintroub@wva. +2 -0
> >  Bug#34085 - create table on falcon hangs if it cannot allocate
> pagecache
> >  In this case, pagecache size was too big, initialization failed and
> user
> >  was confronted with incomprehensible error message from CREATE
> TABLE.
> >
> >  Solution : now Falcon will be initialized at database startup.
> Plugin
> >  will not be loaded on failed allocation and this will make
> configuration
> >  issues more obvious to DBA.
> >
> >  storage/falcon/StorageHandler.cpp@stripped, 2008-02-24 16:47:58+01:00,
> vvaintroub@wva. +16 -23
> >    (re)throw exceptions in storageHandler::initialize() - they
> >    will be caught later in falcon_init()
> >
> >  storage/falcon/ha_falcon.cpp@stripped, 2008-02-24 16:47:59+01:00,
> vvaintroub@wva. +29 -15
> >    Initialize falcon at database startup. Return error to plugin API
> >    if initialization fails.
> >
> >diff -Nrup a/storage/falcon/StorageHandler.cpp
> b/storage/falcon/StorageHandler.cpp
> >--- a/storage/falcon/StorageHandler.cpp	2008-01-31 20:25:44 +01:00
> >+++ b/storage/falcon/StorageHandler.cpp	2008-02-24 16:47:58 +01:00
> >@@ -921,31 +921,24 @@ void StorageHandler::initialize(void)
> > 		// lead to "recreate" and data loss.
> > 		int err = e.getSqlcode();
> > 		if(err == OUT_OF_MEMORY_ERROR || err == FILE_ACCESS_ERROR)
> >-			return;
> >-		try
> >-			{
> >-			defaultDatabase->createDatabase();
> >-			IO::deleteFile(FALCON_USER);
> >-			IO::deleteFile(FALCON_TEMPORARY);
> >-			dictionaryConnection = defaultDatabase-
> >getOpenConnection();
> >-			Statement *statement = dictionaryConnection-
> >createStatement();
> >+			throw;
> >+		defaultDatabase->createDatabase();
> >+		IO::deleteFile(FALCON_USER);
> >+		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);
> >+		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);
> >-
> >-			statement->close();
> >-			dictionaryConnection->commit();
> >-			}
> >-		catch(...)
> >-			{
> >-			return;
> >-			}
> >+		for (const char **ddl = falconSchema; *ddl; ++ddl)
> >+			statement->executeUpdate(*ddl);
> >+
> >+		statement->close();
> >+		dictionaryConnection->commit();
> > 		}
> > }
> >
> >diff -Nrup a/storage/falcon/ha_falcon.cpp
> b/storage/falcon/ha_falcon.cpp
> >--- a/storage/falcon/ha_falcon.cpp	2008-02-06 18:38:23 +01:00
> >+++ b/storage/falcon/ha_falcon.cpp	2008-02-24 16:47:59 +01:00
> >@@ -148,6 +148,7 @@ int StorageInterface::falcon_init(void *
> > {
> > 	DBUG_ENTER("falcon_init");
> > 	falcon_hton = (handlerton *)p;
> >+	my_bool error = false;
> >
> > 	if (!storageHandler)
> > 		storageHandler = getFalconStorageHandler(sizeof(THR_LOCK));
> >@@ -203,11 +204,30 @@ int StorageInterface::falcon_init(void *
> > 	if (falcon_debug_server)
> > 		storageHandler->startNfsServer();
> >
> >-	//TimeTest timeTest;
> >-	//timeTest.testScaled(16, 2, 100000);
> >+	try
> >+		{
> >+		storageHandler->initialize();
> >+		}
> >+	catch(SQLException &e)
> >+		{
> >+		sql_print_error("Falcon : exception '%s'during
> initialization",
> >+			e.getText());
> >+		error = true;
> >+		}
> >+	catch(...)
> >+		{
> >+		sql_print_error(" Falcon : general exception in
> initialization");
> >+		error = true;
> >+		}
> >
> >-	//pluginHandler = new NfsPluginHandler;
> >
> >+	if (error)
> >+		{
> >+			// Cleanup after error
> >+			delete storageHandler;
> >+			storageHandler = 0;
> >+			DBUG_RETURN(1);
> >+		}
> > 	DBUG_RETURN(0);
> > }
> >
> >@@ -225,7 +245,7 @@ int falcon_strnxfrm (void *cs,
> > {
> > 	CHARSET_INFO *charset = (CHARSET_INFO*) cs;
> >
> >-	return charset->coll->strnxfrm(charset, (uchar *) dst, dstlen,
> nweights,
> >+	return (int)charset->coll->strnxfrm(charset, (uchar *) dst,
> dstlen, nweights,
> > 	                              (uchar *) src, srclen, 0);
> > }
> >
> >@@ -3080,25 +3100,19 @@ void StorageInterface::updateConsistentR
> > void StorageInterface::updateRecordMemoryMax(MYSQL_THD thd, struct
> st_mysql_sys_var* variable, void* var_ptr,
> >void* save)
> > {
> > 	falcon_record_memory_max = *(ulonglong*) save;
> >-
> >-	if (storageHandler)
> >-		storageHandler-
> >setRecordMemoryMax(falcon_record_memory_max);
> >+	storageHandler->setRecordMemoryMax(falcon_record_memory_max);
> > }
> >
> > void StorageInterface::updateRecordScavengeThreshold(MYSQL_THD thd,
> struct st_mysql_sys_var* variable, void*
> >var_ptr, void* save)
> > {
> >-	falcon_record_scavenge_threshold = *(int*) save;
> >-
> >-	if (storageHandler)
> >-		storageHandler-
> >setRecordScavengeThreshold(falcon_record_scavenge_threshold);
> >+	falcon_record_scavenge_threshold = *(uint*) save;
> >+	storageHandler-
> >setRecordScavengeThreshold(falcon_record_scavenge_threshold);
> > }
> >
> > void StorageInterface::updateRecordScavengeFloor(MYSQL_THD thd,
> struct st_mysql_sys_var* variable, void*
> >var_ptr, void* save)
> > {
> >-	falcon_record_scavenge_floor = *(int*) save;
> >-
> >-	if (storageHandler)
> >-		storageHandler-
> >setRecordScavengeFloor(falcon_record_scavenge_floor);
> >+	falcon_record_scavenge_floor = *(uint*) save;
> >+	storageHandler-
> >setRecordScavengeFloor(falcon_record_scavenge_floor);
> > }
> >
> >
> >
> >
> >
> >--
> >MySQL Code Commits Mailing List
> >For list archives: http://lists.mysql.com/commits
> >To unsubscribe:
> http://lists.mysql.com/commits?unsub=1


Thread
bk commit into 6.0 tree (vvaintroub:1.2822) BUG#34085vvaintroub24 Feb 2008
  • RE: bk commit into 6.0 tree (vvaintroub:1.2822) BUG#34085Kevin Lewis25 Feb 2008
    • RE: bk commit into 6.0 tree (vvaintroub:1.2822) BUG#34085Vladislav Vaintroub25 Feb 2008
      • RE: bk commit into 6.0 tree (vvaintroub:1.2822) BUG#34085Vladislav Vaintroub25 Feb 2008