Commit 68bd14d0 authored by unknown's avatar unknown
Browse files

ndb - Embryo of overload protection

  Add method to query free send buffer size


ndb/include/transporter/TransporterRegistry.hpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/SCI_Transporter.cpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/SCI_Transporter.hpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/SHM_Buffer.hpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/SHM_Transporter.cpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/SHM_Transporter.hpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/SendBuffer.cpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/SendBuffer.hpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/TCP_Transporter.cpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/TCP_Transporter.hpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/Transporter.hpp:
  Allow accessing free send buffer size
ndb/src/common/transporter/TransporterRegistry.cpp:
  Allow accessing free send buffer size
ndb/src/mgmsrv/ConfigInfo.cpp:
  Increse min values for SHM and TCP transport send buffer size
parent cdb27307
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -179,6 +179,13 @@ public:
  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
   *
+5 −4
Original line number Diff line number Diff line
@@ -1023,7 +1023,8 @@ SCI_Transporter::initSCI() {
  DBUG_RETURN(true);
} 
 
 
 
 
 
Uint32
SCI_Transporter::get_free_buffer() const
{
  return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer();
}
+2 −1
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ public:
   */ 
  bool getConnectionStatus(); 

  virtual Uint32 get_free_buffer() const;   
private: 
  SCI_Transporter(TransporterRegistry &t_reg,
                  const char *local_host,
+17 −0
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ public:

  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);

@@ -213,4 +214,20 @@ SHM_Writer::updateWritePtr(Uint32 sz){
  * 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
+6 −0
Original line number Diff line number Diff line
@@ -362,3 +362,9 @@ SHM_Transporter::doSend()
    kill(m_remote_pid, g_ndb_shm_signum);
  }
}

Uint32
SHM_Transporter::get_free_buffer() const 
{
  return writer->get_free_buffer();
}
Loading