List:Commits« Previous MessageNext Message »
From:msvensson Date:December 21 2006 12:08pm
Subject:bk commit into 5.1 tree (msvensson:1.2374)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson 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, 2006-12-21 12:08:39+01:00, msvensson@stripped +1 -0
  Merge neptunus:mysql/my51-ndb-valgrind
  into  pilot.mysql.com:/home/msvensson/mysql/mysql-5.1-new-ndb
  MERGE: 1.2370.1.2

  sql/ha_ndbcluster_binlog.cc@stripped, 2006-12-21 12:08:31+01:00, msvensson@stripped
+0 -0
    Auto merged
    MERGE: 1.91.1.1

# 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:	msvensson
# Host:	pilot.mysql.com
# Root:	/home/msvensson/mysql/mysql-5.1-new-ndb/RESYNC

--- 1.92/sql/ha_ndbcluster_binlog.cc	2006-12-20 15:34:37 +01:00
+++ 1.93/sql/ha_ndbcluster_binlog.cc	2006-12-21 12:08:31 +01:00
@@ -81,6 +81,8 @@
 static Ndb *injector_ndb= 0;
 static Ndb *schema_ndb= 0;
 
+static int ndbcluster_binlog_inited= 0;
+
 /*
   Mutex and condition used for interacting between client sql thread
   and injector thread
@@ -558,29 +560,28 @@
   DBUG_VOID_RETURN;
 }
 
+
 /*
-  End use of the NDB Cluster table handler
-  - free all global variables allocated by 
-    ndbcluster_init()
+  End use of the NDB Cluster binlog
+   - wait for binlog thread to shutdown
 */
 
 static int ndbcluster_binlog_end(THD *thd)
 {
-  DBUG_ENTER("ndb_binlog_end");
+  DBUG_ENTER("ndbcluster_binlog_end");
 
-  if (!ndbcluster_util_inited)
+  if (!ndbcluster_binlog_inited)
     DBUG_RETURN(0);
-
-  // Kill ndb utility thread
-  (void) pthread_mutex_lock(&LOCK_ndb_util_thread);
-  DBUG_PRINT("exit",("killing ndb util thread: %lx", ndb_util_thread));
-  (void) pthread_cond_signal(&COND_ndb_util_thread);
-  (void) pthread_mutex_unlock(&LOCK_ndb_util_thread);
+  ndbcluster_binlog_inited= 0;
 
 #ifdef HAVE_NDB_BINLOG
   /* wait for injector thread to finish */
+  pthread_mutex_lock(&injector_mutex);
   if (ndb_binlog_thread_running > 0)
   {
+    pthread_cond_signal(&injector_cond);
+    pthread_mutex_unlock(&injector_mutex);
+
     pthread_mutex_lock(&injector_mutex);
     while (ndb_binlog_thread_running > 0)
     {
@@ -588,8 +589,9 @@
       set_timespec(abstime, 1);
       pthread_cond_timedwait(&injector_cond, &injector_mutex, &abstime);
     }
-    pthread_mutex_unlock(&injector_mutex);
   }
+  pthread_mutex_unlock(&injector_mutex);
+
 
   /* remove all shares */
   {
@@ -617,8 +619,10 @@
     }
     pthread_mutex_unlock(&ndbcluster_mutex);
   }
+
+  pthread_mutex_destroy(&injector_mutex);
+  pthread_cond_destroy(&injector_cond);
 #endif
-  ndbcluster_util_inited= 0;
   DBUG_RETURN(0);
 }
 
@@ -2286,31 +2290,21 @@
     DBUG_RETURN(-1);
   }
 
-  /*
-    Wait for the ndb injector thread to finish starting up.
-  */
+  ndbcluster_binlog_inited= 1;
+
+  /* Wait for the injector thread to start */
   pthread_mutex_lock(&injector_mutex);
   while (!ndb_binlog_thread_running)
     pthread_cond_wait(&injector_cond, &injector_mutex);
   pthread_mutex_unlock(&injector_mutex);
-  
+
   if (ndb_binlog_thread_running < 0)
     DBUG_RETURN(-1);
 
+
   DBUG_RETURN(0);
 }
 
-static void ndbcluster_binlog_close_connection(THD *thd)
-{
-  DBUG_ENTER("ndbcluster_binlog_close_connection");
-  const char *save_info= thd->proc_info;
-  thd->proc_info= "ndbcluster_binlog_close_connection";
-  do_ndbcluster_binlog_close_connection= BCCC_exit;
-  while (ndb_binlog_thread_running > 0)
-    sleep(1);
-  thd->proc_info= save_info;
-  DBUG_VOID_RETURN;
-}
 
 /**************************************************************
   Internal helper functions for creating/dropping ndb events
@@ -3953,6 +3947,7 @@
     goto restart;
   }
 err:
+  sql_print_information("Stopping Cluster Binlog");
   DBUG_PRINT("info",("Shutting down cluster binlog thread"));
   thd->proc_info= "Shutting down";
   close_thread_tables(thd);
@@ -3964,8 +3959,6 @@
   schema_ndb= 0;
   pthread_mutex_unlock(&injector_mutex);
   thd->db= 0; // as not to try to free memory
-
-  sql_print_information("Stopping Cluster Binlog");
 
   if (ndb_apply_status_share)
   {
Thread
bk commit into 5.1 tree (msvensson:1.2374)msvensson21 Dec