List:Commits« Previous MessageNext Message »
From:jonas Date:June 26 2007 4:03am
Subject:bk commit into 5.1 tree (jonas:1.2546)
View as plain text  
Below is the list of changes that have just been committed into a local
5.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@stripped, 2007-06-26 06:03:31+02:00, jonas@stripped +10 -0
  ndb -
    1) Add new interface for thread safe prepareSend
    2) Add common SendBuffer
    3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/include/transporter/TransporterRegistry.hpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +24 -2
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/common/transporter/Makefile.am@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +1 -1
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/common/transporter/TCP_Transporter.cpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +173 -59
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/common/transporter/TCP_Transporter.hpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +4 -5
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/common/transporter/Transporter.cpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +12 -0
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/common/transporter/Transporter.hpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +4 -2
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/common/transporter/TransporterInternalDefinitions.hpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +2 -0
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/common/transporter/TransporterRegistry.cpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +87 -20
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/kernel/vm/Configuration.cpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +7 -0
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

  storage/ndb/src/ndbapi/TransporterFacade.cpp@stripped, 2007-06-26 06:03:28+02:00, jonas@stripped +5 -0
    ndb -
      1) Add new interface for thread safe prepareSend
      2) Add common SendBuffer
      3) Make TCP transport struc iovec - i.e impl. native thread safty

# 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:	jonas
# Host:	eel.hemma.oreland.se
# Root:	/home/jonas/src/51-telco-trp

--- 1.25/storage/ndb/include/transporter/TransporterRegistry.hpp	2006-12-23 20:20:08 +01:00
+++ 1.26/storage/ndb/include/transporter/TransporterRegistry.hpp	2007-06-26 06:03:28 +02:00
@@ -88,6 +88,7 @@
  */
 class TransporterRegistry {
   friend class SHM_Transporter;
+  friend class TCP_Transporter;
   friend class Transporter;
   friend class TransporterService;
 public:
@@ -107,6 +108,7 @@
   NdbMgmHandle get_mgm_handle(void) { return m_mgm_handle; };
 
   bool init(NodeId localNodeId);
+  bool alloc_buffers();
 
   /**
    * after a connect from client, perform connection using correct transporter
@@ -264,10 +266,30 @@
   Transporter* get_transporter(NodeId nodeId);
   NodeId get_localNodeId() { return localNodeId; };
 
-
   struct in_addr get_connect_address(NodeId node_id) const;
-protected:
+
+  struct thr_client_r* create_client(NodeId = 0);
+  void destroy_client(struct thr_client_r*);
+  int reset_node(struct thr_client_r*, Uint32 nodeId);
+  SendStatus prepareSend(struct thr_client_r*,
+			 const SignalHeader * const, Uint8,
+			 const Uint32 * const, 
+			 const LinearSectionPtr ptr[3]);
+  SendStatus flush(struct thr_client_r*);
   
+  /**
+   * backward compability layer
+   */
+  SendStatus prepareSend(Transporter*, struct iovec*, Uint32);
+private:
+  /**
+   * buffer mgm
+   */
+  Uint32* alloc_buffer();
+  Uint32 get_buffer(struct thr_client_r*, Uint32 sz, Uint32* dst[2]);
+  void release_buffers(struct iovec*, Uint32);
+  Uint32 m_send_buffer_size;
+  Uint32* m_first_free_buffer;
 private:
   void * callbackObj;
 

--- 1.17/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2007-04-05 15:14:10 +02:00
+++ 1.18/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2007-06-26 06:03:28 +02:00
@@ -82,8 +82,7 @@
 	      conf->serverNodeId,
 	      0, false, 
 	      conf->checksum,
-	      conf->signalId),
-  m_sendBuffer(conf->tcp.sendBufferSize)
+	      conf->signalId)
 {
   maxReceiveSize = conf->tcp.maxReceiveSize;
   
@@ -98,6 +97,10 @@
   setIf(sockOptRcvBufSize, conf->tcp.tcpRcvBufSize, 70080);
   setIf(sockOptSndBufSize, conf->tcp.tcpSndBufSize, 71540);
   setIf(sockOptTcpMaxSeg, conf->tcp.tcpMaxsegSize, 0);
+
+  m_send_bytes = 0;
+  m_send_buffers = 0;
+  m_send_buffer_pos = 0;
 }
 
 TCP_Transporter::~TCP_Transporter() {
@@ -148,14 +151,18 @@
   if(!receiveBuffer.init(recBufSize+MAX_MESSAGE_SIZE)){
     return false;
   }
-  
-  // Allocate buffers for sending
-  if (!m_sendBuffer.initBuffer(remoteNodeId)) {
-    // XXX What shall be done here? 
-    // The same is valid for the other init-methods 
-    return false;
-  }
-  
+
+  Uint32 n = 0;
+  Uint32 bufsz = m_transporter_registry.m_send_buffer_size;
+  while(bufsz) { n++; bufsz /= 2; }
+  
+  if (n < 16)
+    n = 16;
+  
+  m_send_buffers = new struct iovec [n];
+  m_send_buffers[0].iov_len = 0;
+  m_send_buffers[0].iov_base = 0;
+
   return true;
 }
 
@@ -271,47 +278,89 @@
 Uint32
 TCP_Transporter::get_free_buffer() const 
 {
-  return m_sendBuffer.bufferSizeRemaining();
+  return 0;
 }
 
 Uint32 *
-TCP_Transporter::getWritePtr(Uint32 lenBytes, Uint32 prio){
-  
-  Uint32 * insertPtr = m_sendBuffer.getInsertPtr(lenBytes);
-  
-  struct timeval timeout = {0, 10000};
+TCP_Transporter::getWritePtr(Uint32 lenBytes, Uint32 prio)
+{
+loop:
+  Uint32 bytes = m_send_bytes;
+  Uint32 idx = m_send_buffer_pos;
+  struct iovec* buf = m_send_buffers + idx;
+  Uint32 pos = buf->iov_len;
+  char *ptr = (char*)buf->iov_base;
 
-  if (insertPtr == 0) {
-    //-------------------------------------------------
-    // Buffer was completely full. We have severe problems.
-    // We will attempt to wait for a small time
-    //-------------------------------------------------
-    if(sendIsPossible(&timeout)) {
-      //-------------------------------------------------
-      // Send is possible after the small timeout.
-      //-------------------------------------------------
-      if(!doSend()){
-	return 0;
-      } else {
-	//-------------------------------------------------
-	// Since send was successful we will make a renewed
-	// attempt at inserting the signal into the buffer.
-	//-------------------------------------------------
-        insertPtr = m_sendBuffer.getInsertPtr(lenBytes);
-      }//if
-    } else {
-      return 0;
-    }//if
+  if (pos + lenBytes < NDB_TRANSPORTER_PAGE_SIZE)
+  {
+    return (Uint32*)(ptr + pos);
+  }
+  else if (pos + lenBytes == NDB_TRANSPORTER_PAGE_SIZE)
+  {
+    buf++;
+    buf->iov_len = 0;
+    if ((buf->iov_base = m_transporter_registry.alloc_buffer()) != 0)
+    {
+      return (Uint32*)(ptr + pos);      
+    }
+  }
+  else if ((ptr = (char*)m_transporter_registry.alloc_buffer()) != 0)
+  {
+    buf++;
+    buf->iov_len = 0;
+    buf->iov_base = ptr;
+    return (Uint32*)ptr;
   }
-  return insertPtr;
+  
+  doSend();
+  if (m_send_bytes != bytes)
+  {
+    goto loop;
+  }
+  return 0;
 }
 
 void
-TCP_Transporter::updateWritePtr(Uint32 lenBytes, Uint32 prio){
-  m_sendBuffer.updateInsertPtr(lenBytes);
+TCP_Transporter::updateWritePtr(Uint32 lenBytes, Uint32 prio)
+{
+  Uint32 bytes = m_send_bytes;
+  Uint32 idx = m_send_buffer_pos;
+  struct iovec* buf = m_send_buffers + idx;
+  Uint32 pos = buf->iov_len;
+  char *ptr = (char*)buf->iov_base;
+  Uint32 newPos = pos + lenBytes;
+
+  if (newPos < NDB_TRANSPORTER_PAGE_SIZE)
+  {
+    buf->iov_len = newPos;
+  }
+  else if (newPos == NDB_TRANSPORTER_PAGE_SIZE)
+  {
+    buf->iov_len = NDB_TRANSPORTER_PAGE_SIZE;    
+    m_send_buffer_pos = idx + 1;
+  }
+  else
+  {
+    buf->iov_len = NDB_TRANSPORTER_PAGE_SIZE;
+    
+    buf++;
+    Uint32 slack = NDB_TRANSPORTER_PAGE_SIZE - pos;
+    assert(pos < NDB_TRANSPORTER_PAGE_SIZE);
+    assert(ptr);
+    memcpy(ptr+pos, buf->iov_base, slack);
+    
+    ptr = (char*)buf->iov_base;
+    memmove(ptr, ptr + slack, lenBytes - slack);
+    
+    buf->iov_len = lenBytes - slack;
+    m_send_buffer_pos = idx + 1;
+  }
   
-  const int bufsize = m_sendBuffer.bufferSize();
-  if(bufsize > TCP_SEND_LIMIT) {
+  bytes += lenBytes;
+  m_send_bytes = bytes;
+
+  if(bytes > (Uint32)TCP_SEND_LIMIT) 
+  {
     //-------------------------------------------------
     // Buffer is full and we are ready to send. We will
     // not wait since the signal is already in the buffer.
@@ -321,7 +370,8 @@
     // a renewed trial.
     //-------------------------------------------------
     struct timeval no_timeout = {0,0};
-    if(sendIsPossible(&no_timeout)) {
+    if(sendIsPossible(&no_timeout)) 
+    {
       //-------------------------------------------------
       // Send was possible, attempt at a send.
       //-------------------------------------------------
@@ -335,7 +385,10 @@
 
 
 bool
-TCP_Transporter::doSend() {
+TCP_Transporter::doSend() 
+{
+  const Uint32 bytes = m_send_bytes;
+
   // If no sendbuffers are used nothing is done
   // Sends the contents of the SendBuffers until they are empty
   // or until select does not select the socket for write.
@@ -343,32 +396,91 @@
   // using "select"
   // It writes on the external TCP/IP interface until the send buffer is empty
   // and as long as write is possible (test it using select)
-
-  // Empty the SendBuffers
+  Uint32 cnt = m_send_buffer_pos;
+  Uint32 sum = 0;
+  
+#ifdef VM_TRACE
+  {
+    for (Uint32 tmp = 0; tmp <= m_send_buffer_pos; tmp++)
+      sum += m_send_buffers[tmp].iov_len;
+    assert(sum == bytes);
+  }
+#endif
   
-  const char * const sendPtr = m_sendBuffer.sendPtr;
-  const Uint32 sizeToSend    = m_sendBuffer.sendDataSize;
-  if (sizeToSend > 0){
-    const int nBytesSent = send(theSocket, sendPtr, sizeToSend, 0);
+  // Empty the SendBuffers
+  if (bytes)
+  {
+    const int nBytesSent = writev(theSocket, m_send_buffers, cnt + 1);
     
-    if (nBytesSent > 0) {
-      m_sendBuffer.bytesSent(nBytesSent);
+    if (nBytesSent > 0) 
+    {
+      assert(nBytesSent <= (int)bytes);
       
       sendCount ++;
       sendSize  += nBytesSent;
-      if(sendCount == reportFreq){
+      if(sendCount == reportFreq)
+      {
 	reportSendLen(get_callback_obj(), remoteNodeId, sendCount, sendSize);
 	sendCount = 0;
 	sendSize  = 0;
       }
+
+      if (nBytesSent == (int)bytes)
+      {
+	m_send_buffer_pos = 0;
+	m_send_buffers[0].iov_len = 0;
+	m_transporter_registry.release_buffers(m_send_buffers + 1, cnt);
+      }
+      else
+      {
+	sum = 0;
+	Uint32 relcnt = 0;
+	Uint32 len;
+	struct iovec* buf = m_send_buffers;
+	for (; ; relcnt++, buf++)
+	{
+	  len = buf->iov_len;
+	  if (sum + len < (Uint32)nBytesSent)
+	  {
+	    sum += len;
+	  }
+	  else
+	  {
+	    break;
+	  }
+	}
+	
+	m_transporter_registry.release_buffers(m_send_buffers, relcnt);
+	Uint32 last = (nBytesSent - sum); // How much was sent on last page
+	Uint32 slack = len - last;        // 
+	buf->iov_len = slack;
+	memmove(buf->iov_base, ((char*)buf->iov_base)+last, slack);
+	memmove(m_send_buffers, m_send_buffers+relcnt,
+		(1 + cnt - relcnt)*sizeof(struct iovec));
+	
+	assert(slack < NDB_TRANSPORTER_PAGE_SIZE);
+	m_send_buffer_pos -= relcnt;
+      }
+      m_send_bytes = bytes - nBytesSent;
+
+#ifdef VM_TRACE
+      {
+	Uint32 sum = 0;
+	for (Uint32 i = 0; i <= m_send_buffer_pos; i++)
+	{
+	  sum += m_send_buffers[i].iov_len;
+	}
+	assert(sum == m_send_bytes);
+      }
+#endif
     } else {
       // Send failed
-#if defined DEBUG_TRANSPORTER
+#if 0
       g_eventLogger.error("Send Failure(disconnect==%d) to node = %d nBytesSent = %d "
-	       "errno = %d strerror = %s",
-	       DISCONNECT_ERRNO(InetErrno, nBytesSent),
-	       remoteNodeId, nBytesSent, InetErrno, 
-	       (char*)ndbstrerror(InetErrno));
+			  "errno = %d strerror = %s",
+			  DISCONNECT_ERRNO(InetErrno, nBytesSent),
+			  remoteNodeId, nBytesSent, InetErrno, 
+			  (char*)ndbstrerror(InetErrno));
 #endif   
       if(DISCONNECT_ERRNO(InetErrno, nBytesSent)){
 	doDisconnect();
@@ -448,7 +560,9 @@
   
   // Empty send och receive buffers 
   receiveBuffer.clear();
-  m_sendBuffer.emptyBuffer();
 
+  m_transporter_registry.release_buffers(m_send_buffers, m_send_buffer_pos);
+  m_send_buffers[0].iov_len = 0;
+  
   theSocket = NDB_INVALID_SOCKET;
 }

--- 1.11/storage/ndb/src/common/transporter/TCP_Transporter.hpp	2007-05-18 10:08:27 +02:00
+++ 1.12/storage/ndb/src/common/transporter/TCP_Transporter.hpp	2007-06-26 06:03:28 +02:00
@@ -113,10 +113,9 @@
   virtual void disconnectImpl();
   
 private:
-  /**
-   * Send buffers
-   */
-  SendBuffer m_sendBuffer;
+  Uint32 m_send_bytes;
+  Uint32 m_send_buffer_pos;
+  struct iovec * m_send_buffers;
   
   // Sending/Receiving socket used by both client and server
   NDB_SOCKET_TYPE theSocket;   
@@ -176,7 +175,7 @@
 inline
 bool
 TCP_Transporter::hasDataToSend() const {
-  return m_sendBuffer.dataSize > 0;
+  return m_send_bytes > 0;
 }
 
 inline

--- 1.30/storage/ndb/src/common/transporter/Transporter.cpp	2007-03-06 18:36:38 +01:00
+++ 1.31/storage/ndb/src/common/transporter/Transporter.cpp	2007-06-26 06:03:28 +02:00
@@ -238,3 +238,15 @@
   m_connected= false;
   disconnectImpl();
 }
+
+/**
+ * Backward compability method,
+ *  If Transporter does not override this method
+ *  use the TransporterRegistry impl. which uses
+ *  old api (getWritePtr/updateWritePtr)
+ */
+SendStatus
+Transporter::prepareSend(TransporterRegistry* trp, struct iovec* buf, Uint32 n)
+{
+  return trp->prepareSend(this, buf, n);
+}

--- 1.17/storage/ndb/src/common/transporter/Transporter.hpp	2007-01-31 08:32:12 +01:00
+++ 1.18/storage/ndb/src/common/transporter/Transporter.hpp	2007-06-26 06:03:28 +02:00
@@ -136,8 +136,10 @@
   bool compressionUsed;
   bool checksumUsed;
   bool signalIdUsed;
-  Packer m_packer;  
-
+  Packer m_packer;
+  
+  virtual SendStatus prepareSend(TransporterRegistry*, struct iovec*, Uint32);
+  
 private:
 
   /**

--- 1.5/storage/ndb/src/common/transporter/TransporterInternalDefinitions.hpp	2006-12-23 20:20:13 +01:00
+++ 1.6/storage/ndb/src/common/transporter/TransporterInternalDefinitions.hpp	2007-06-26 06:03:28 +02:00
@@ -42,6 +42,8 @@
 #define WARNING(X)
 #endif
 
+#define NDB_TRANSPORTER_PAGE_SIZE 32768
+
 // Calculate a checksum
 inline
 Uint32

--- 1.73/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2007-05-18 11:16:48 +02:00
+++ 1.74/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2007-06-26 06:03:28 +02:00
@@ -99,7 +99,8 @@
   nTCPTransporters = 0;
   nSCITransporters = 0;
   nSHMTransporters = 0;
-  
+  m_send_buffer_size = 0;
+
   // Initialize the transporter arrays
   for (unsigned i=0; i<maxTransporters; i++) {
     theTCPTransporters[i] = NULL;
@@ -270,7 +271,7 @@
 bool
 TransporterRegistry::createTCPTransporter(TransporterConfiguration *config) {
 #ifdef NDB_TCP_TRANSPORTER
-
+  
   if(!nodeIdSpecified){
     init(config->localNodeId);
   }
@@ -280,23 +281,9 @@
   
   if(theTransporters[config->remoteNodeId] != NULL)
     return false;
-   
+  
   TCP_Transporter * t = new TCP_Transporter(*this, config);
-
-#if 0
-					    config->tcp.sendBufferSize,
-					    config->tcp.maxReceiveSize,
-					    config->localHostName,
-					    config->remoteHostName,
-					    config->s_port,
-					    config->isMgmConnection,
-					    localNodeId,
-					    config->remoteNodeId,
-					    config->serverNodeId,
-					    config->checksum,
-					    config->signalId);
-#endif
-
+  
   if (t == NULL) 
     return false;
   else if (!t->initTransporter()) {
@@ -311,7 +298,8 @@
   performStates[t->getRemoteNodeId()]       = DISCONNECTED;
   nTransporters++;
   nTCPTransporters++;
-
+  
+  m_send_buffer_size += config->tcp.sendBufferSize;
   return true;
 #else
   return false;
@@ -550,7 +538,7 @@
 	  reportError(callbackObj, nodeId, TE_SEND_BUFFER_FULL);
 	  return SEND_OK;
 	}
-	
+
 	WARNING("Signal to " << nodeId << " lost(buffer)");
 	reportError(callbackObj, nodeId, TE_SIGNAL_LOST_SEND_BUFFER_FULL);
 	return SEND_BUFFER_FULL;
@@ -643,6 +631,85 @@
     
     return SEND_BLOCKED;
   }
+}
+
+
+/**
+ * Transporter(s) that does not support (nativly)
+ *   the thr_client_r interface
+ *   uses this method...
+ */
+SendStatus
+TransporterRegistry::prepareSend(Transporter* t, 
+				 struct iovec* buf, 
+				 Uint32 lenBytes)
+{
+  Uint32 i;
+  Uint32 cnt = (lenBytes + 32767) / 32768;
+  SendStatus ss = SEND_OK;
+  
+  if(t->isConnected())
+  {
+    Uint32 * insertPtr = t->getWritePtr(lenBytes, 0);
+    if(insertPtr != 0)
+    {
+      for (i = 0; i<cnt; i++)
+      {
+	Uint32 sz = buf[i].iov_len;
+	assert((sz & 3) == 0);
+	sz /= 4;
+	memcpy(insertPtr, buf[i].iov_base, sz);
+	insertPtr += sz;
+      }
+      t->updateWritePtr(lenBytes, 0);
+      goto done;
+    }
+	
+    /**
+     * @note: on linux/i386 the granularity is 10ms
+     *        so sleepTime = 2 generates a 10 ms sleep.
+     */
+    int sleepTime = 2;
+    for(Uint32 loop = 0; loop<50; loop++){
+      if((nSHMTransporters+nSCITransporters) == 0)
+	NdbSleep_MilliSleep(sleepTime); 
+      insertPtr = t->getWritePtr(lenBytes, 0);
+      if(insertPtr != 0)
+      {
+	for (i = 0; i<cnt; i++)
+	{
+	  Uint32 sz = buf[i].iov_len;
+	  assert((sz & 3) == 0);
+	  sz /= 4;
+	  memcpy(insertPtr, buf[i].iov_base, sz);
+	  insertPtr += sz;
+	}
+	t->updateWritePtr(lenBytes, 0);
+	break;
+      }
+    }
+
+    Uint32 nodeId = t->remoteNodeId;
+    if(insertPtr != 0)
+    {
+      /**
+       * Send buffer full, but resend works
+       */
+      reportError(callbackObj, nodeId, TE_SEND_BUFFER_FULL);
+      goto done;
+    }
+    
+    WARNING("Signal to " << nodeId << " lost(buffer)");
+    reportError(callbackObj, nodeId, TE_SIGNAL_LOST_SEND_BUFFER_FULL);
+    ss = SEND_BUFFER_FULL;
+    goto done;
+  } 
+
+  ss = SEND_DISCONNECTED;
+
+done:
+  release_buffers(buf, cnt);
+  return ss;
 }
 
 void

--- 1.57/storage/ndb/src/kernel/vm/Configuration.cpp	2007-01-24 06:20:36 +01:00
+++ 1.58/storage/ndb/src/kernel/vm/Configuration.cpp	2007-06-26 06:03:28 +02:00
@@ -414,6 +414,13 @@
     }
   }
 
+  if (globalTransporterRegistry.alloc_buffers() != true)
+  {
+    ERROR_SET(fatal, NDBD_EXIT_MEMALLOC, 
+	      "Failed to alloc send buffers", 
+	      "Failed to alloc send buffers");
+  }
+
   /**
    * Setup cluster configuration data
    */

--- 1.66/storage/ndb/src/ndbapi/TransporterFacade.cpp	2007-05-03 14:30:16 +02:00
+++ 1.67/storage/ndb/src/ndbapi/TransporterFacade.cpp	2007-06-26 06:03:28 +02:00
@@ -691,6 +691,11 @@
     TRP_DEBUG( "configureTransporters returned 0 or less" );
     DBUG_RETURN(false);
   }
+
+  if (theTransporterRegistry->alloc_buffers() != true)
+  {
+    DBUG_RETURN(false);
+  }
   
   ndb_mgm_configuration_iterator iter(* props, CFG_SECTION_NODE);
   iter.first();

--- 1.14/storage/ndb/src/common/transporter/Makefile.am	2006-12-31 01:06:42 +01:00
+++ 1.15/storage/ndb/src/common/transporter/Makefile.am	2007-06-26 06:03:28 +02:00
@@ -20,7 +20,7 @@
 	SendBuffer.cpp   \
 	TCP_Transporter.cpp \
 	TransporterRegistry.cpp \
-        Packer.cpp
+        Packer.cpp thr_client_r.cpp
 
 EXTRA_libtransporter_la_SOURCES = SHM_Transporter.cpp SHM_Transporter.unix.cpp SCI_Transporter.cpp
 
Thread
bk commit into 5.1 tree (jonas:1.2546)jonas15 Jul