List:Internals« Previous MessageNext Message »
From:jonas.oreland Date:May 25 2005 2:19pm
Subject:bk commit into 4.1 tree (joreland:1.2268)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jonas. When jonas 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.2268 05/05/25 16:19:17 joreland@stripped +13 -0
  ndb - Embryo of overload protection
    Add method to query free send buffer size

  ndb/src/mgmsrv/ConfigInfo.cpp
    1.55 05/05/25 16:19:14 joreland@stripped +2 -2
    Increse min values for SHM and TCP transport send buffer size

  ndb/src/common/transporter/TransporterRegistry.cpp
    1.26 05/05/25 16:19:14 joreland@stripped +12 -0
    Allow accessing free send buffer size

  ndb/src/common/transporter/Transporter.hpp
    1.6 05/05/25 16:19:14 joreland@stripped +2 -0
    Allow accessing free send buffer size

  ndb/src/common/transporter/TCP_Transporter.hpp
    1.4 05/05/25 16:19:14 joreland@stripped +1 -0
    Allow accessing free send buffer size

  ndb/src/common/transporter/TCP_Transporter.cpp
    1.9 05/05/25 16:19:14 joreland@stripped +5 -0
    Allow accessing free send buffer size

  ndb/src/common/transporter/SendBuffer.hpp
    1.4 05/05/25 16:19:14 joreland@stripped +1 -1
    Allow accessing free send buffer size

  ndb/src/common/transporter/SendBuffer.cpp
    1.2 05/05/25 16:19:14 joreland@stripped +1 -1
    Allow accessing free send buffer size

  ndb/src/common/transporter/SHM_Transporter.hpp
    1.7 05/05/25 16:19:14 joreland@stripped +2 -0
    Allow accessing free send buffer size

  ndb/src/common/transporter/SHM_Transporter.cpp
    1.14 05/05/25 16:19:14 joreland@stripped +6 -0
    Allow accessing free send buffer size

  ndb/src/common/transporter/SHM_Buffer.hpp
    1.7 05/05/25 16:19:14 joreland@stripped +17 -0
    Allow accessing free send buffer size

  ndb/src/common/transporter/SCI_Transporter.hpp
    1.4 05/05/25 16:19:14 joreland@stripped +2 -1
    Allow accessing free send buffer size

  ndb/src/common/transporter/SCI_Transporter.cpp
    1.7 05/05/25 16:19:14 joreland@stripped +5 -4
    Allow accessing free send buffer size

  ndb/include/transporter/TransporterRegistry.hpp
    1.8 05/05/25 16:19:14 joreland@stripped +7 -0
    Allow accessing free send buffer size

# 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:	joreland
# Host:	eel.ndb.mysql.com.ndb.mysql.com
# Root:	/home/jonas/src/mysql-4.1

--- 1.7/ndb/include/transporter/TransporterRegistry.hpp	Wed Dec 22 16:28:56 2004
+++ 1.8/ndb/include/transporter/TransporterRegistry.hpp	Wed May 25 16:19:14 2005
@@ -178,6 +178,13 @@
   bool createTransporter(struct SCI_TransporterConfiguration * config);
   bool createTransporter(struct SHM_TransporterConfiguration * config);
   bool createTransporter(struct OSE_TransporterConfiguration * config);
+
+  /**
+   * Get free buffer space
+   *
+   *   Get #free bytes in send buffer for <em>node</node>
+   */
+  Uint32 get_free_buffer(Uint32 node) const ;
   
   /**
    * prepareSend

--- 1.54/ndb/src/mgmsrv/ConfigInfo.cpp	Thu Mar 10 07:48:43 2005
+++ 1.55/ndb/src/mgmsrv/ConfigInfo.cpp	Wed May 25 16:19:14 2005
@@ -1656,7 +1656,7 @@
     false,
     ConfigInfo::CI_INT,
     "256K",
-    "16K",
+    "64K",
     STR_VALUE(MAX_INT_RNIL) },
 
   {
@@ -1844,7 +1844,7 @@
     false,
     ConfigInfo::CI_INT,
     "1M",
-    "4K",
+    "64K",
     STR_VALUE(MAX_INT_RNIL) },
 
   {

--- 1.6/ndb/src/common/transporter/SCI_Transporter.cpp	Wed Dec 22 16:28:56 2004
+++ 1.7/ndb/src/common/transporter/SCI_Transporter.cpp	Wed May 25 16:19:14 2005
@@ -1023,7 +1023,8 @@
   DBUG_RETURN(true);
 } 
  
- 
- 
- 
- 
+Uint32
+SCI_Transporter::get_free_buffer() const
+{
+  return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer();
+}

--- 1.3/ndb/src/common/transporter/SCI_Transporter.hpp	Mon Sep 20 12:02:20 2004
+++ 1.4/ndb/src/common/transporter/SCI_Transporter.hpp	Wed May 25 16:19:14 2005
@@ -133,7 +133,8 @@
    * remote segment is mapped. Otherwize false. 
    */ 
   bool getConnectionStatus(); 
-   
+
+  virtual Uint32 get_free_buffer() const;   
 private: 
   SCI_Transporter(TransporterRegistry &t_reg,
                   const char *local_host,

--- 1.6/ndb/src/common/transporter/SHM_Buffer.hpp	Mon Sep 20 12:02:20 2004
+++ 1.7/ndb/src/common/transporter/SHM_Buffer.hpp	Wed May 25 16:19:14 2005
@@ -157,6 +157,7 @@
 
   inline Uint32 getWriteIndex() const { return m_writeIndex;}
   inline Uint32 getBufferSize() const { return m_bufferSize;}
+  inline Uint32 get_free_buffer() const;
   
   inline void copyIndexes(SHM_Writer * standbyWriter);
 
@@ -211,6 +212,22 @@
 
   m_writeIndex = tWriteIndex;
   * m_sharedWriteIndex = tWriteIndex;
+}
+
+inline
+Uint32
+SHM_Writer::get_free_buffer() const
+{
+  Uint32 tReadIndex  = * m_sharedReadIndex;
+  Uint32 tWriteIndex = m_writeIndex;
+  
+  Uint32 free;
+  if(tReadIndex <= tWriteIndex){
+    free = m_bufferSize + tReadIndex - tWriteIndex;
+  } else {
+    free = tReadIndex - tWriteIndex;
+  }
+  return free;
 }
  
 #endif

--- 1.13/ndb/src/common/transporter/SHM_Transporter.cpp	Fri Jan 28 00:42:34 2005
+++ 1.14/ndb/src/common/transporter/SHM_Transporter.cpp	Wed May 25 16:19:14 2005
@@ -362,3 +362,9 @@
     kill(m_remote_pid, g_ndb_shm_signum);
   }
 }
+
+Uint32
+SHM_Transporter::get_free_buffer() const 
+{
+  return writer->get_free_buffer();
+}

--- 1.6/ndb/src/common/transporter/SHM_Transporter.hpp	Mon Dec 13 12:50:30 2004
+++ 1.7/ndb/src/common/transporter/SHM_Transporter.hpp	Wed May 25 16:19:14 2005
@@ -137,6 +137,8 @@
   int m_remote_pid;
   Uint32 m_last_signal;
   Uint32 m_signal_threshold;
+
+  virtual Uint32 get_free_buffer() const;
   
 private:
   bool _shmSegCreated;

--- 1.1/ndb/src/common/transporter/SendBuffer.cpp	Wed Apr 14 10:24:12 2004
+++ 1.2/ndb/src/common/transporter/SendBuffer.cpp	Wed May 25 16:19:14 2005
@@ -60,7 +60,7 @@
 }
 
 Uint32
-SendBuffer::bufferSizeRemaining() {
+SendBuffer::bufferSizeRemaining() const {
   return (sizeOfBuffer - dataSize);
 }
 

--- 1.3/ndb/src/common/transporter/SendBuffer.hpp	Tue May 11 22:34:10 2004
+++ 1.4/ndb/src/common/transporter/SendBuffer.hpp	Wed May 25 16:19:14 2005
@@ -51,7 +51,7 @@
   bool initBuffer(Uint32 aRemoteNodeId);  
 
   // Number of bytes remaining in the buffer
-  Uint32 bufferSizeRemaining();
+  Uint32 bufferSizeRemaining() const;
 
   // Number of bytes of data in the buffer 
   int bufferSize(); 

--- 1.8/ndb/src/common/transporter/TCP_Transporter.cpp	Wed Dec 22 16:28:56 2004
+++ 1.9/ndb/src/common/transporter/TCP_Transporter.cpp	Wed May 25 16:19:14 2005
@@ -250,6 +250,11 @@
 #endif
 }
 
+Uint32
+TCP_Transporter::get_free_buffer() const 
+{
+  return m_sendBuffer.bufferSizeRemaining();
+}
 
 Uint32 *
 TCP_Transporter::getWritePtr(Uint32 lenBytes, Uint32 prio){

--- 1.3/ndb/src/common/transporter/TCP_Transporter.hpp	Wed Sep 15 20:25:01 2004
+++ 1.4/ndb/src/common/transporter/TCP_Transporter.hpp	Wed May 25 16:19:14 2005
@@ -99,6 +99,7 @@
    */
   virtual void updateReceiveDataPtr(Uint32 bytesRead);
 
+  virtual Uint32 get_free_buffer() const;
 protected:
   /**
    * Setup client/server and perform connect/accept

--- 1.5/ndb/src/common/transporter/Transporter.hpp	Wed Dec 22 18:27:04 2004
+++ 1.6/ndb/src/common/transporter/Transporter.hpp	Wed May 25 16:19:14 2005
@@ -69,6 +69,8 @@
    */
   NodeId getLocalNodeId() const;
 
+  virtual Uint32 get_free_buffer() const = 0;
+  
 protected:
   Transporter(TransporterRegistry &,
 	      TransporterType,

--- 1.25/ndb/src/common/transporter/TransporterRegistry.cpp	Tue Feb  1 19:01:34 2005
+++ 1.26/ndb/src/common/transporter/TransporterRegistry.cpp	Wed May 25 16:19:14 2005
@@ -523,6 +523,18 @@
   theTransporters[nodeId] = NULL;        
 }
 
+Uint32
+TransporterRegistry::get_free_buffer(Uint32 node) const
+{
+  Transporter *t;
+  if(likely((t = theTransporters[node]) != 0))
+  {
+    return t->get_free_buffer();
+  }
+  return 0;
+}
+
+
 SendStatus
 TransporterRegistry::prepareSend(const SignalHeader * const signalHeader, 
 				 Uint8 prio,
Thread
bk commit into 4.1 tree (joreland:1.2268)jonas.oreland25 May