List:Commits« Previous MessageNext Message »
From:lars-erik.bjork Date:July 18 2008 8:16am
Subject:bzr commit into mysql-6.0-falcon branch (lars-erik.bjork:2757)
View as plain text  
#At file:///home/lb200670/devel/mysql/falcon-bugs/

 2757 lars-erik.bjork@stripped	2008-07-18 [merge]
      Merging ...
modified:
  configure.in
  mysql-test/suite/rpl/t/disabled.def
  storage/falcon/IOx.h
  storage/falcon/StorageHandler.cpp
  storage/falcon/TableSpaceManager.cpp
  storage/falcon/TableSpaceManager.h

=== modified file 'configure.in'
--- a/configure.in	2008-07-14 14:56:49 +0000
+++ b/configure.in	2008-07-17 10:35:38 +0000
@@ -9,7 +9,7 @@ AC_CANONICAL_SYSTEM
 # remember to also update version.c in ndb
 # When changing major version number please also check switch statement
 # in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 6.0.6-alpha)
+AM_INIT_AUTOMAKE(mysql, 6.0.7-alpha)
 AM_CONFIG_HEADER([include/config.h:config.h.in])
 
 NDB_VERSION_MAJOR=6

=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def	2008-07-14 16:34:51 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def	2008-07-17 10:44:32 +0000
@@ -35,3 +35,9 @@ rpl_row_basic_2myisam      : Bug#37879 2
 rpl_row_basic_3innodb      : Bug#37879 2008-07-14 alik Disabled to make 6.0 greaner (the test fails too often)
 rpl_heartbeat              : Bug#37714 2008-07-14 alik Disabled to make 6.0 greaner (the test fails too often)
 rpl_idempotency            : Bug#37767 2008-07-14 alik Disabled to make 6.0 greaner (the test fails too often)
+
+rpl_flushlog_loop          : Bug#37733 2008-07-17 alik Disabled to make 6.0 greaner (the test fails too often)
+rpl_locktrans_innodb       : Bug#37712 2008-07-17 alik Disabled to make 6.0 greaner (the test fails too often)
+rpl_temporary              : Bug#34647 2008-07-17 alik Disabled to make 6.0 greaner (the test fails too often)
+rpl_temporary_errors       : Bug#36968 2008-07-17 alik Disabled to make 6.0 greaner (the test fails too often)
+

=== modified file 'storage/falcon/IOx.h'
--- a/storage/falcon/IOx.h	2008-07-17 13:52:17 +0000
+++ b/storage/falcon/IOx.h	2008-07-18 08:15:54 +0000
@@ -54,8 +54,8 @@ public:
 	void	writeHeader (Hdr *header);
 	int		read(int length, UCHAR *buffer);
 	void	write(uint32 length, const UCHAR *data);
-	bool	doesFileExist(const char *fileName);
-	int		fileStat(const char *fileName, struct stat *stats = NULL, int *errnum = NULL);
+	static bool	doesFileExist(const char *fileName);
+	static int	fileStat(const char *fileName, struct stat *stats = NULL, int *errnum = NULL);
 	void	declareFatalError();
 	void	seek (int pageNumber);
 	void	closeFile();

=== modified file 'storage/falcon/StorageHandler.cpp'
--- a/storage/falcon/StorageHandler.cpp	2008-07-17 13:52:17 +0000
+++ b/storage/falcon/StorageHandler.cpp	2008-07-18 08:15:54 +0000
@@ -35,6 +35,10 @@
 #include "InfoTable.h"
 #include "CmdGen.h"
 #include "Dbb.h"
+#include "Database.h"
+#include "TableSpaceManager.h"
+
+
 
 #define DICTIONARY_ACCOUNT		"mysql"
 #define DICTIONARY_PW			"mysql"
@@ -477,10 +481,16 @@ int StorageHandler::createTablespace(con
 
 	if (!dictionaryConnection)
 		return StorageErrorTablesSpaceOperationFailed;
-		
-	//StorageDatabase *storageDatabase = NULL;
+
 	JString tableSpace = JString::upcase(tableSpaceName);
-	
+
+	TableSpaceManager *tableSpaceManager = 
+		dictionaryConnection->database->tableSpaceManager;
+
+	if (!tableSpaceManager->waitForPendingDrop(tableSpaceName, 10))
+		// file still exists after waiting for 10 seconds
+		return  StorageErrorTableSpaceExist;
+
 	try
 		{
 		JString cmd = genCreateTableSpace(tableSpaceName, filename, comment);

=== modified file 'storage/falcon/TableSpaceManager.cpp'
--- a/storage/falcon/TableSpaceManager.cpp	2008-07-17 13:52:17 +0000
+++ b/storage/falcon/TableSpaceManager.cpp	2008-07-18 08:15:54 +0000
@@ -162,32 +162,10 @@ TableSpace* TableSpaceManager::createTab
 	
 	TableSpace *tableSpace = new TableSpace(database, name, id, fileName, type, tsInit);
 	
-	if (!repository)
+	if (!repository && IO::doesFileExist(fileName))
 		{
-		bool fileExists;
-
-		// Check if table space file already exists.
-		// Take into account, that tablespace might have been already  dropped
-		// by another transaction, yet file can still be present on the disk,
-		// if log record is not yet fully committed by the gopher thread).
-		// So we'll wait for a few seconds if there are pending drops and 
-		// tablespace file exists.
-
-		for (int i=0; i < 10; i++)
-			{
-			fileExists = tableSpace->dbb->doesFileExist(fileName);
-
-			if (fileExists && pendingDrops > 0)
-				Thread::getThread("TableSpaceManager::createTableSpace")->sleep(1000);
-			else
-				break;
-			}
-
-		if (fileExists)
-			{
-			delete tableSpace;
-			throw SQLError(TABLESPACE_DATAFILE_EXIST_ERROR, "table space file name \"%s\" already exists\n", fileName);
-			}
+		delete tableSpace;
+		throw SQLError(TABLESPACE_DATAFILE_EXIST_ERROR, "table space file name \"%s\" already exists\n", fileName);
 		}
 		
 	try
@@ -522,3 +500,25 @@ void TableSpaceManager::getTableSpaceFil
 }
 
 
+// Wait for specified amount of time for a  file to be deleted.
+// Don't wait if pendingDrops count is 0.
+//
+// The function returns true, if wait was successfull, i.e file does not exist
+//(anymore)
+bool TableSpaceManager::waitForPendingDrop(const char  *filename, int seconds)
+{
+	bool fileExists;
+
+	do
+		{
+		fileExists = IO::doesFileExist(filename);
+		if (fileExists && pendingDrops > 0 && seconds-- > 0)
+			Thread::getThread("TransactionManager::waitForPendingDrop")->sleep(1000);
+		else
+			break;
+		}
+	while(true);
+
+	return !fileExists;
+}
+

=== modified file 'storage/falcon/TableSpaceManager.h'
--- a/storage/falcon/TableSpaceManager.h	2008-06-08 22:12:35 +0000
+++ b/storage/falcon/TableSpaceManager.h	2008-07-17 20:38:45 +0000
@@ -62,6 +62,7 @@ public:
 	void			reportWrites(void);
 	void			redoCreateTableSpace(int id, int nameLength, const char* name, int fileNameLength, const char* fileName, int type, TableSpaceInit* tsInit);
 	void			initialize(void);
+	bool			waitForPendingDrop(const char *filename, int seconds);
 
 	Database	*database;
 	TableSpace	*tableSpaces;

Thread
bzr commit into mysql-6.0-falcon branch (lars-erik.bjork:2757) lars-erik.bjork18 Jul