List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:September 14 2008 10:00pm
Subject:bzr commit into mysql-5.1 branch (jonas:2761)
View as plain text  
#At file:///home/jonas/src/telco-6.4/

 2761 Jonas Oreland	2008-09-14
      ndb - nasty hack for handling dataevent *prior* to sub_start_conf
modified:
  storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
  storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp

=== modified file 'storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2008-09-13 09:55:40 +0000
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2008-09-14 20:00:09 +0000
@@ -611,8 +611,9 @@ NdbEventOperationImpl::execute_nolock()
   Uint32 buckets = 0;
   int r= NdbDictionaryImpl::getImpl(*myDict).executeSubscribeEvent(*this,
                                                                    buckets);
-  if (r == 0) {
-    m_ndb->theEventBuffer->m_total_buckets = buckets;
+  if (r == 0) 
+  {
+    m_ndb->theEventBuffer->set_total_buckets(buckets);
 
     if (theMainOp == NULL) {
       DBUG_PRINT("info", ("execute blob ops"));
@@ -1042,10 +1043,10 @@ NdbEventOperationImpl::printAll()
  * Class NdbEventBuffer
  * Each Ndb object has a Object.
  */
-
+#define TOTAL_BUCKETS_INIT (1 << 15)
 
 NdbEventBuffer::NdbEventBuffer(Ndb *ndb) :
-  m_total_buckets(0),
+  m_total_buckets(TOTAL_BUCKETS_INIT), 
   m_min_gci_index(0),
   m_max_gci_index(0),
   m_ndb(ndb),
@@ -2195,6 +2196,42 @@ NdbEventBuffer::handle_change_nodegroup(
 }
 
 void
+NdbEventBuffer::set_total_buckets(Uint32 cnt)
+{
+  if (m_total_buckets == cnt)
+    return;
+
+  assert(m_total_buckets == TOTAL_BUCKETS_INIT);
+  m_total_buckets = cnt;
+
+  Uint64 * array = m_known_gci.getBase();
+  Uint32 mask = m_known_gci.size() - 1;
+  Uint32 minpos = m_min_gci_index;
+  Uint32 maxpos = m_max_gci_index;
+
+  bool found = false;
+  Uint32 pos = minpos;
+  for (; pos != maxpos; pos = (pos + 1) & mask)
+  {
+    Gci_container* tmp = find_bucket(array[pos]);
+    assert(tmp->m_gcp_complete_rep_count >= TOTAL_BUCKETS_INIT);
+    tmp->m_gcp_complete_rep_count -= TOTAL_BUCKETS_INIT;
+    if (tmp->m_gcp_complete_rep_count == 0)
+    {
+      found = true;
+      if (0)
+        ndbout_c("set_total_buckets(%u) complete %u/%u",
+                 cnt, Uint32(tmp->m_gci >> 32), Uint32(tmp->m_gci));
+      complete_bucket(tmp);
+    }
+  }
+  if (found)
+  {
+    NdbCondition_Signal(p_cond);
+  }
+}
+
+void
 NdbEventBuffer::report_node_connected(Uint32 node_id)
 {
   NdbEventOperation* op= m_ndb->getEventOperation(0);

=== modified file 'storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2008-09-12 12:55:29 +0000
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2008-09-14 20:00:09 +0000
@@ -666,6 +666,9 @@ private:
   void resize_known_gci();
 
   void handle_change_nodegroup(const SubGcpCompleteRep*);
+
+public:
+  void set_total_buckets(Uint32);
 };
 
 inline

Thread
bzr commit into mysql-5.1 branch (jonas:2761) Jonas Oreland14 Sep