List:Commits« Previous MessageNext Message »
From:Martin Skold Date:February 13 2008 11:40am
Subject:bk commit into 5.1 tree (mskold:1.2706)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mskold.  When mskold 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, 2008-02-13 11:39:57+01:00, mskold@stripped +3 -0
  WL#4083 Resource shortage handling in event mechanism: Post review fixes

  storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2008-02-13 11:39:47+01:00,
mskold@stripped +3 -1
    WL#4083 Resource shortage handling in event mechanism: Post review fixes

  storage/ndb/src/kernel/blocks/suma/Suma.cpp@stripped, 2008-02-13 11:39:47+01:00,
mskold@stripped +8 -6
    WL#4083 Resource shortage handling in event mechanism: Post review fixes

  storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp@stripped, 2008-02-13 11:39:47+01:00,
mskold@stripped +6 -3
    WL#4083 Resource shortage handling in event mechanism: Post review fixes

diff -Nrup a/storage/ndb/src/common/debugger/EventLogger.cpp
b/storage/ndb/src/common/debugger/EventLogger.cpp
--- a/storage/ndb/src/common/debugger/EventLogger.cpp	2008-02-11 14:24:16 +01:00
+++ b/storage/ndb/src/common/debugger/EventLogger.cpp	2008-02-13 11:39:47 +01:00
@@ -996,8 +996,10 @@ void getTextSubscriptionStatus(QQQQ)
   case(1): // SubscriptionStatus::DISCONNECTED
     BaseString::snprintf(m_text, m_text_len,
                          "Disconnecting node %u because it has "
-                         "exceeded MaxBufferedEpochs, gci %lld",
+                         "exceeded MaxBufferedEpochs (%llu > %u), gci %llu",
                          theData[2],
+                         make_uint64(theData[5], theData[6]),
+                         theData[7],
                          make_uint64(theData[3], theData[4]));
     break;
   case(2): // SubscriptionStatus::INCONSISTENT
diff -Nrup a/storage/ndb/src/kernel/blocks/suma/Suma.cpp
b/storage/ndb/src/kernel/blocks/suma/Suma.cpp
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2008-02-11 15:05:02 +01:00
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2008-02-13 11:39:47 +01:00
@@ -3590,8 +3590,9 @@ Suma::checkMaxBufferedGCP(Signal *signal
     // Disconnect lagging subscribers
     for(; !gcp.isNull(); c_gcp_list.next(gcp))
     {
+      Uint64 lag = m_max_seen_gci - gcp.p->m_gci;
       jam();
-      if (m_max_seen_gci - gcp.p->m_gci >= (Uint64) c_maxBufferedGcp)
+      if (lag >= (Uint64) c_maxBufferedGcp)
       {
         jam();
         for(Uint32 nodeId = 0; nodeId < MAX_NODES; nodeId++)
@@ -3606,10 +3607,10 @@ Suma::checkMaxBufferedGCP(Signal *signal
            signal->theData[2] = nodeId;
            signal->theData[3] = (Uint32) gcp.p->m_gci;
            signal->theData[4] = (Uint32) (gcp.p->m_gci >> 32);
-           sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 5, JBB);
-           infoEvent("MaxBufferedEpochs %llu exceeded %u",
-                     m_max_seen_gci - gcp.p->m_gci,
-                     c_maxBufferedGcp);
+           signal->theData[5] = (Uint32) lag;
+           signal->theData[6] = (Uint32) (lag >> 32); 
+           signal->theData[7] = c_maxBufferedGcp;
+           sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 8, JBB);
 
             /**
              * Force API_FAILREQ
@@ -5072,9 +5073,10 @@ Suma::start_resend(Signal* signal, Uint3
     c_gcp_list.last(gcp);
     signal->theData[0] = NDB_LE_SubscriptionStatus;
     signal->theData[1] = 2; // INCONSISTENT;
+    signal->theData[2] = 0; // Not used
     signal->theData[3] = (Uint32) pos.m_max_gci;
     signal->theData[4] = (Uint32) (gcp.p->m_gci >> 32);
-    sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
+    sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 5, JBB);
     m_missing_data = true;
     return;
   }
diff -Nrup a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2008-02-11 14:24:16 +01:00
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2008-02-13 11:39:47 +01:00
@@ -1270,7 +1270,7 @@ NdbEventBuffer::nextEvent()
 #endif
 
   EventBufData *data;
-  Uint64 gci;
+  Uint64 gci= 0;
   while ((data= m_available_data.m_head))
   {
     NdbEventOperationImpl *op= data->m_event_op;
@@ -1280,7 +1280,10 @@ NdbEventBuffer::nextEvent()
      * possibly a dummy event list marking missing data
      */
     if (!op && !isConsistent(gci))
+    {
+      DBUG_PRINT_EVENT("info", ("detected inconsistent gci %u", gci));
       DBUG_RETURN_EVENT(0);
+    }
 
     DBUG_PRINT_EVENT("info", ("available data=%p op=%p", data, op));
 
@@ -1879,7 +1882,7 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP
 
   if (rep->flags & SubGcpCompleteRep::MISSING_DATA)
   {
-    bucket->m_state |= Gci_container::GC_INCONSISTENT;
+    bucket->m_state = Gci_container::GC_INCONSISTENT;
   }
 
   Uint32 old_cnt = bucket->m_gcp_complete_rep_count;
@@ -1931,7 +1934,7 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP
                          Uint32(gci >> 32), Uint32(gci),
                          Uint32(minGCI >> 32), Uint32(minGCI),
                          Uint32(m_latestGCI >> 32), Uint32(m_latestGCI));
-      bucket->m_state |= Gci_container::GC_COMPLETE;
+      bucket->m_state = Gci_container::GC_COMPLETE;
       bucket->m_gcp_complete_rep_count = 1; // Prevent from being reused
       m_latest_complete_GCI = gci;
     }
Thread
bk commit into 5.1 tree (mskold:1.2706)Martin Skold13 Feb