List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:July 14 2008 5:28am
Subject:push into mysql-6.0-falcon branch (cpowers:2741) Bug#38043
View as plain text  
------------------------------------------------------------
revno: 2741
revision-id: cpowers@stripped
parent: hakan@stripped
committer: Christopher Powers <cpowers@stripped>
branch nick: mysql
timestamp: Mon 2008-07-14 00:27:57 -0500
message:
  Bug#38043: Deadlock between server and falcon
  
  Temporarily disable online alter until StorageTableShare::getIndex() is fixed.
modified:
  storage/falcon/StorageTableShare.cpp
sp1f-storagetableshare.cp-20070920154241-vvalybxfgcqwykomxt46wvm7kfy6es43
  storage/falcon/ha_falcon.cpp  
sp1f-ha_falcon.cpp-20070920154249-uqjdwxhhwka2rvk2bmhxzzoozrzokdjq
=== modified file 'storage/falcon/StorageTableShare.cpp'
--- a/storage/falcon/StorageTableShare.cpp	2008-07-09 10:23:27 +0000
+++ b/storage/falcon/StorageTableShare.cpp	2008-07-14 05:27:57 +0000
@@ -38,7 +38,7 @@
 static const char *DB_ROOT				= ".fts";
 
 #ifndef ONLINE_ALTER
-#define ONLINE_ALTER
+//#define ONLINE_ALTER
 #endif
 
 #if defined(_WIN32) && MYSQL_VERSION_ID < 0x50100
@@ -283,16 +283,26 @@
 
 StorageIndexDesc* StorageTableShare::getIndex(int indexCount, int indexId,
StorageIndexDesc* indexDesc)
 {
-	// Rebuild array if indexes have been added or dropped. Assume
StorageTableShare::lock(exclusive).
+	// Rebuild array if indexes have been added or dropped
 	
 #ifdef ONLINE_ALTER
+
+	// TODO: This does not work. It should be done at the time of index creation
+
 	if (indexes && (numberIndexes != indexCount))
 		{
+		Sync sync(syncObject, "StorageTableShare::getIndex");
+		sync.lock(Exclusive);
+		StorageIndexDesc **oldIndexes = indexes;
+		StorageIndexDesc **newIndexes = new StorageIndexDesc*[indexCount];
+		memset(newIndexes, 0, indexCount * sizeof(StorageIndexDesc*));
+		
 		for (int n = 0; n < numberIndexes; ++n)
-			delete indexes[n];
-			
-		delete [] indexes;
-		indexes = NULL;
+			newIndexes[n] = indexes[n];
+		
+		indexes = newIndexes;
+		numberIndexes = indexCount;
+		delete [] oldIndexes;
 		}
 #endif
 	

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2008-07-09 10:23:27 +0000
+++ b/storage/falcon/ha_falcon.cpp	2008-07-14 05:27:57 +0000
@@ -54,7 +54,7 @@
 #endif
 
 #ifndef ONLINE_ALTER
-#define ONLINE_ALTER
+//#define ONLINE_ALTER
 #endif
 
 #ifdef DEBUG_BACKLOG

Thread
push into mysql-6.0-falcon branch (cpowers:2741) Bug#38043Christopher Powers14 Jul