List:Commits« Previous MessageNext Message »
From:jonas oreland Date:November 22 2011 9:25am
Subject:bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4685 to 4686)
View as plain text  
 4686 jonas oreland	2011-11-22
      ndb index stat
        This patch adds a "is_setup_complete" method to Ndb_index_stat_thread
        The makes ndb-wait-setup also wait for ndb_index_stat_allow() == true
          if index-stat is enabled.
      
        This is good for several reasons, but not complete!
          We should later also check that not only "ndb_index_stat_allow() == true"
          but that the actual tables has been created, and that the listener is setup.
          However, all of this can be coded inside Ndb_index_stat_thread::is_setup_complete

    modified:
      sql/ha_ndb_index_stat.cc
      sql/ha_ndb_index_stat.h
      sql/ha_ndbcluster.cc
 4685 jonas oreland	2011-11-22
      ndb - fix race discovered when working on trpman
        interestingly enough, the race was fixed for CM_REGREQ but not for API_REGREQ
        weird?

    modified:
      storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
      storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
      storage/ndb/src/kernel/blocks/trpman.cpp
=== modified file 'sql/ha_ndb_index_stat.cc'
--- a/sql/ha_ndb_index_stat.cc	2011-11-20 15:07:32 +0000
+++ b/sql/ha_ndb_index_stat.cc	2011-11-22 08:56:11 +0000
@@ -2131,6 +2131,16 @@ ndb_index_stat_stop_listener(Ndb_index_s
   DBUG_RETURN(0);
 }
 
+bool
+Ndb_index_stat_thread::is_setup_complete()
+{
+  if (ndb_index_stat_get_enable(NULL))
+  {
+    return ndb_index_stat_allow();
+  }
+  return true;
+}
+
 void
 Ndb_index_stat_thread::do_run()
 {

=== modified file 'sql/ha_ndb_index_stat.h'
--- a/sql/ha_ndb_index_stat.h	2011-11-20 15:00:14 +0000
+++ b/sql/ha_ndb_index_stat.h	2011-11-22 08:56:11 +0000
@@ -47,6 +47,8 @@ public:
   pthread_mutex_t stat_mutex;
   pthread_cond_t stat_cond;
 
+  /* are we setup */
+  bool is_setup_complete();
 private:
   virtual int do_init() { return 0;}
   virtual void do_run();

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-11-20 15:00:14 +0000
+++ b/sql/ha_ndbcluster.cc	2011-11-22 08:56:11 +0000
@@ -12260,6 +12260,12 @@ static int connect_callback()
   return 0;
 }
 
+/**
+ * Components
+ */
+Ndb_util_thread ndb_util_thread;
+Ndb_index_stat_thread ndb_index_stat_thread;
+
 #ifndef NDB_NO_WAIT_SETUP
 static int ndb_wait_setup_func_impl(ulong max_wait)
 {
@@ -12269,10 +12275,11 @@ static int ndb_wait_setup_func_impl(ulon
 
   struct timespec abstime;
   set_timespec(abstime, 1);
-  
-  while (!ndb_setup_complete && max_wait)
+
+  while (max_wait &&
+         (!ndb_setup_complete || !ndb_index_stat_thread.is_setup_complete()))
   {
-    int rc= pthread_cond_timedwait(&COND_ndb_setup_complete, 
+    int rc= pthread_cond_timedwait(&COND_ndb_setup_complete,
                                    &ndbcluster_mutex,
                                    &abstime);
     if (rc)
@@ -12302,12 +12309,6 @@ int(*ndb_wait_setup_func)(ulong) = 0;
 #endif
 extern int ndb_dictionary_is_mysqld;
 
-/**
- * Components
- */
-Ndb_util_thread ndb_util_thread;
-Ndb_index_stat_thread ndb_index_stat_thread;
-
 static int ndbcluster_init(void *p)
 {
   DBUG_ENTER("ndbcluster_init");

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4685 to 4686) jonas oreland22 Nov