List:Internals« Previous MessageNext Message »
From:tomas Date:November 1 2005 9:47am
Subject:bk commit into 5.1 tree (tomas:1.1949)
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.1949 05/11/01 10:46:59 tomas@stripped +3 -0
  corrected problem with too much reporting of event buffer status

  storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
    1.9 05/11/01 10:46:50 tomas@stripped +1 -1
    corrected problem with too much reporting of event buffer status

  storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
    1.24 05/11/01 10:46:50 tomas@stripped +43 -16
    corrected problem with too much reporting of event buffer status

  storage/ndb/src/ndbapi/Ndb.cpp
    1.60 05/11/01 10:46:50 tomas@stripped +6 -1
    corrected problem with too much reporting of event buffer status

# 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-wl2325-5.0

--- 1.59/storage/ndb/src/ndbapi/Ndb.cpp	2005-09-15 12:30:50 +02:00
+++ 1.60/storage/ndb/src/ndbapi/Ndb.cpp	2005-11-01 10:46:50 +01:00
@@ -1305,7 +1305,12 @@
 
 void Ndb::setReportThreshEventFreeMem(unsigned thresh)
 {
-  theEventBuffer->m_free_thresh= thresh;
+  if (theEventBuffer->m_free_thresh != thresh)
+  {
+    theEventBuffer->m_free_thresh= thresh;
+    theEventBuffer->m_min_free_thresh= thresh;
+    theEventBuffer->m_max_free_thresh= 100;
+  }
 }
 
 #ifdef VM_TRACE

--- 1.23/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2005-10-26 22:50:46 +02:00
+++ 1.24/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2005-11-01 10:46:50 +01:00
@@ -539,6 +539,8 @@
   m_latestGCI(0),
   m_total_alloc(0),
   m_free_thresh(10),
+  m_min_free_thresh(10),
+  m_max_free_thresh(100),
   m_gci_slip_thresh(3),
   m_dropped_ev_op(0),
   m_active_op_count(0)
@@ -635,7 +637,6 @@
   EventBufData_chunk *chunk_data=
     (EventBufData_chunk *)NdbMem_Allocate(alloc_size);
 
-  m_total_alloc+= alloc_size;
 
   chunk_data->sz= sz;
   m_allocated_data.push_back(chunk_data);
@@ -902,8 +903,8 @@
 	assert(bucket->m_data.m_count);
 #endif
 	m_complete_data.m_data.append(bucket->m_data);
-	reportStatus();
       }
+      reportStatus();
       bzero(bucket, sizeof(Gci_container));
       bucket->m_gci = gci + ACTIVE_GCI_DIRECTORY_SIZE;
       bucket->m_gcp_complete_rep_count = m_system_nodes;
@@ -1356,23 +1357,49 @@
   else
     apply_gci= latest_gci;
 
-  if (100*m_free_data_sz < m_free_thresh*m_total_alloc ||
-      latest_gci-apply_gci >=  m_gci_slip_thresh)
+
+  if (100*m_free_data_sz < m_min_free_thresh*m_total_alloc &&
+      m_total_alloc > 1024*1024)
   {
-    Uint32 data[8];
-    data[0]= NDB_LE_EventBufferStatus;
-    data[1]= m_total_alloc-m_free_data_sz;
-    data[2]= m_total_alloc;
-    data[3]= 0;
-    data[4]= apply_gci & ~(Uint32)0;
-    data[5]= apply_gci >> 32;
-    data[6]= latest_gci & ~(Uint32)0;
-    data[7]= latest_gci >> 32;
-    m_ndb->theImpl->send_event_report(data,8);
+    /* report less free buffer than m_free_thresh,
+       next report when more free than 2 * m_free_thresh
+    */
+    m_min_free_thresh= 0;
+    m_max_free_thresh= 2 * m_free_thresh;
+    goto send_report;
+  }
+
+  if (100*m_free_data_sz > m_max_free_thresh*m_total_alloc &&
+      m_total_alloc > 1024*1024)
+  {
+    /* report more free than 2 * m_free_thresh
+       next report when less free than m_free_thresh
+    */
+    m_min_free_thresh= m_free_thresh;
+    m_max_free_thresh= 100;
+    goto send_report;
+  }
+
+  if (latest_gci-apply_gci >=  m_gci_slip_thresh)
+  {
+    goto send_report;
+  }
+  return;
+
+send_report:
+  Uint32 data[8];
+  data[0]= NDB_LE_EventBufferStatus;
+  data[1]= m_total_alloc-m_free_data_sz;
+  data[2]= m_total_alloc;
+  data[3]= 0;
+  data[4]= apply_gci & ~(Uint32)0;
+  data[5]= apply_gci >> 32;
+  data[6]= latest_gci & ~(Uint32)0;
+  data[7]= latest_gci >> 32;
+  m_ndb->theImpl->send_event_report(data,8);
 #ifdef VM_TRACE
-    assert(m_total_alloc >= m_free_data_sz);
+  assert(m_total_alloc >= m_free_data_sz);
 #endif
-  }
 }
 
 template class Vector<Gci_container>;

--- 1.8/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2005-09-15 12:30:51 +02:00
+++ 1.9/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2005-11-01 10:46:50 +01:00
@@ -271,7 +271,7 @@
   unsigned m_total_alloc; // total allocated memory
 
   // threshholds to report status
-  unsigned m_free_thresh;
+  unsigned m_free_thresh, m_min_free_thresh, m_max_free_thresh;
   unsigned m_gci_slip_thresh;
 
   NdbError m_error;
Thread
bk commit into 5.1 tree (tomas:1.1949)tomas1 Nov