List:Commits« Previous MessageNext Message »
From:tomas Date:May 10 2006 11:34am
Subject:bk commit into 5.1 tree (tomas:1.2392)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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
  1.2392 06/05/10 13:33:17 tomas@stripped +1 -0
  ndb: fix assertion code in event code during cluster shutdown

  storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
    1.57 06/05/10 13:32:50 tomas@stripped +27 -17
    ndb: fix assertion code in event code during cluster shutdown

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

--- 1.56/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2006-05-09 21:08:01 +02:00
+++ 1.57/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2006-05-10 13:32:50 +02:00
@@ -1519,31 +1519,19 @@
   {
     NdbEventOperationImpl* impl= &op->m_impl;
     data.senderData = impl->m_oid;
-    insertDataL(impl, &data, ptr); 
+    insertDataL(impl, &data, ptr);
   } while((op = m_ndb->getEventOperation(op)));
   
   /**
-   * Find min not completed GCI
+   *  Release all GCI's with m_gci > gci
    */
   Uint32 i;
   Uint32 sz= m_active_gci.size();
-  Uint64 gci= ~0;
+  Uint64 gci= data.gci;
   Gci_container* bucket = 0;
   Gci_container* array = (Gci_container*)m_active_gci.getBase();
   for(i = 0; i < sz; i++)
   {
-    if(array[i].m_gcp_complete_rep_count && array[i].m_gci < gci)
-    {
-      bucket= array + i;
-      gci = bucket->m_gci;
-    }
-  }
-
-  /**
-   * Release all GCI's with m_gci > gci
-   */
-  for(i = 0; i < sz; i++)
-  {
     Gci_container* tmp = array + i;
     if (tmp->m_gci > gci)
     {
@@ -1554,9 +1542,31 @@
       tmp->~Gci_container();
       bzero(tmp, sizeof(Gci_container));
     }
+    else if (tmp->m_gcp_complete_rep_count)
+    {
+      if (tmp->m_gci == gci)
+      {
+        bucket= tmp;
+        continue;
+      }
+      // we have found an old not-completed gci
+      // something is wrong, assert in debug, but try so salvage
+      // in release
+      ndbout_c("out of order bucket detected at cluster disconnect, "
+               "data.gci: %u.  tmp->m_gci: %u",
+               (unsigned)data.gci, (unsigned)tmp->m_gci);
+      assert(false);
+      if(!tmp->m_data.is_empty())
+      {
+        free_list(tmp->m_data);
+      }
+      tmp->~Gci_container();
+      bzero(tmp, sizeof(Gci_container));
+    }
   }
-  
-  assert(bucket != 0 && data.gci == gci);
+
+  assert(bucket != 0);
+
   const Uint32 cnt= bucket->m_gcp_complete_rep_count = 1; 
   bucket->m_gci = gci;
   bucket->m_gcp_complete_rep_count = cnt;
Thread
bk commit into 5.1 tree (tomas:1.2392)tomas10 May