List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:April 19 2007 9:05am
Subject:bk commit into 5.1 tree (serg:1.2582)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of serg. When serg 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-19 11:05:25+02:00, serg@stripped +3 -0
  mysql-test/t/ndb_dd_basic.test
      fixed the test
  sql/ha_ndbcluster.cc
      LOCK_plugin is used in ha_ndbcluster.cc
  sql/sql_plugin.cc
      LOCK_plugin is used in ha_ndbcluster.cc

  mysql-test/t/ndb_dd_basic.test@stripped, 2007-04-19 11:05:21+02:00, serg@stripped +0 -1
    fixed the test

  sql/ha_ndbcluster.cc@stripped, 2007-04-19 11:05:22+02:00, serg@stripped +12 -0
    LOCK_plugin is used in ha_ndbcluster.cc

  sql/sql_plugin.cc@stripped, 2007-04-19 11:05:22+02:00, serg@stripped +1 -1
    LOCK_plugin is used in ha_ndbcluster.cc

# 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:	serg
# Host:	janus.mylan
# Root:	/usr/home/serg/Abk/mysql-5.1-wl2936

--- 1.10/mysql-test/t/ndb_dd_basic.test	2007-04-19 11:05:32 +02:00
+++ 1.11/mysql-test/t/ndb_dd_basic.test	2007-04-19 11:05:32 +02:00
@@ -25,7 +25,6 @@
 UNDO_BUFFER_SIZE = 1M
 ENGINE=MYISAM;
 
---error ER_UNKNOWN_STORAGE_ENGINE
 ALTER LOGFILE GROUP lg1
 ADD UNDOFILE 'undofile02.dat'
 INITIAL_SIZE = 4M 

--- 1.442/sql/ha_ndbcluster.cc	2007-04-19 11:05:32 +02:00
+++ 1.443/sql/ha_ndbcluster.cc	2007-04-19 11:05:32 +02:00
@@ -6851,6 +6851,7 @@
 }
 
 extern int ndb_dictionary_is_mysqld;
+extern pthread_mutex_t LOCK_plugin;
 
 static int ndbcluster_init(void *p)
 {
@@ -6860,6 +6861,13 @@
   if (ndbcluster_inited)
     DBUG_RETURN(FALSE);
 
+  /*
+    Below we create new THD's. They'll need LOCK_plugin, but it's taken now by
+    plugin initialization code. Release it to avoid deadlocks.  It's safe, as
+    there're no threads that may concurrently access plugin control structures.
+  */
+  pthread_mutex_unlock(&LOCK_plugin);
+
   pthread_mutex_init(&ndbcluster_mutex,MY_MUTEX_INIT_FAST);
   pthread_mutex_init(&LOCK_ndb_util_thread, MY_MUTEX_INIT_FAST);
   pthread_cond_init(&COND_ndb_util_thread, NULL);
@@ -6998,6 +7006,8 @@
     goto ndbcluster_init_error;
   }
 
+  pthread_mutex_lock(&LOCK_plugin);
+
   ndbcluster_inited= 1;
   DBUG_RETURN(FALSE);
 
@@ -7009,6 +7019,8 @@
     delete g_ndb_cluster_connection;
   g_ndb_cluster_connection= NULL;
   ndbcluster_hton->state= SHOW_OPTION_DISABLED;               // If we couldn't use handler
+
+  pthread_mutex_lock(&LOCK_plugin);
 
   DBUG_RETURN(TRUE);
 }

--- 1.51/sql/sql_plugin.cc	2007-04-19 11:05:32 +02:00
+++ 1.52/sql/sql_plugin.cc	2007-04-19 11:05:32 +02:00
@@ -99,7 +99,7 @@
   following variables/structures.
   We are always manipulating ref count, so a rwlock here is unneccessary.
 */
-static pthread_mutex_t LOCK_plugin;
+pthread_mutex_t LOCK_plugin;
 static DYNAMIC_ARRAY plugin_dl_array;
 static DYNAMIC_ARRAY plugin_array;
 static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM];
Thread
bk commit into 5.1 tree (serg:1.2582)Sergei Golubchik19 Apr