List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:February 8 2011 2:45pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:4183)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped

 4183 Jonas Oreland	2011-02-08
      ndb - port new tup-features from spj to mainline

    modified:
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2011-02-07 13:21:49 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2011-02-08 14:45:27 +0000
@@ -2467,6 +2467,9 @@ private:
 
   Uint32 read_lcp(const Uint32 *, Uint32, KeyReqStruct*, Uint32*);
   void update_lcp(KeyReqStruct *req_struct, const Uint32* src, Uint32 len);
+
+  void flush_read_buffer(KeyReqStruct *, const Uint32* outBuf,
+			 Uint32 resultRef, Uint32 resultData, Uint32 routeRef);
 public:
   /**
    * Used by Restore...

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp	2011-02-08 14:45:27 +0000
@@ -201,7 +201,7 @@ void Dbtup::sendReadAttrinfo(Signal* sig
       /**
        * Send long signal to DBUTIL.
        */
-      if (block == DBUTIL && !old_dest) {
+      if ((block == DBUTIL || block == DBSPJ) && !old_dest) {
 	jam();
 	LinearSectionPtr ptr[3];
 	ptr[0].p= &signal->theData[25];

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2011-02-08 14:45:27 +0000
@@ -2526,6 +2526,36 @@ Dbtup::read_pseudo(const Uint32 * inBuff
     outBuffer[1] = req_struct->operPtrP->m_copy_tuple_location.m_page_no;
     outBuffer[2] = req_struct->operPtrP->m_copy_tuple_location.m_page_idx;
     break;
+  case AttributeHeader::FLUSH_AI:
+  {
+    jam();
+    Uint32 resultRef = inBuffer[inPos];
+    Uint32 resultData = inBuffer[inPos + 1];
+    Uint32 routeRef = inBuffer[inPos + 2];
+    flush_read_buffer(req_struct, outBuf, resultRef, resultData, routeRef);
+    return 3;
+  }
+  case AttributeHeader::CORR_FACTOR32:
+  {
+    jam();
+    signal->theData[0] = req_struct->operPtrP->userpointer;
+    signal->theData[1] = AttributeHeader::CORR_FACTOR64;
+    EXECUTE_DIRECT(DBLQH, GSN_READ_PSEUDO_REQ, signal, 2);
+    sz = 1;
+    outBuffer[1] = signal->theData[0];
+    break;
+  }
+  case AttributeHeader::CORR_FACTOR64:
+  {
+    jam();
+    signal->theData[0] = req_struct->operPtrP->userpointer;
+    signal->theData[1] = AttributeHeader::CORR_FACTOR64;
+    EXECUTE_DIRECT(DBLQH, GSN_READ_PSEUDO_REQ, signal, 2);
+    sz = 2;
+    outBuffer[1] = signal->theData[0];
+    outBuffer[2] = signal->theData[1];
+    break;
+  }
   case AttributeHeader::FRAGMENT_EXTENT_SPACE:
   {
     Uint64 res[2];
@@ -2700,6 +2730,56 @@ error:  
   return 0;
 }
 
+#include <signaldata/TransIdAI.hpp>
+
+void
+Dbtup::flush_read_buffer(KeyReqStruct *req_struct,
+			 const Uint32 * outBuf,
+			 Uint32 resultRef,
+                         Uint32 resultData,
+                         Uint32 routeRef)
+{
+  Uint32 sig1= req_struct->trans_id1;
+  Uint32 sig2= req_struct->trans_id2;
+  Uint32 len = (req_struct->out_buf_index >> 2) - 1;
+  Signal * signal = req_struct->signal;
+
+  bool connectedToNode= getNodeInfo(refToNode(resultRef)).m_connected;
+
+  LinearSectionPtr ptr[3];
+  ptr[0].p= (Uint32*)outBuf; // Should really remove this
+  ptr[0].sz= len;
+
+  TransIdAI * transIdAI=  (TransIdAI *)signal->getDataPtrSend();
+  transIdAI->connectPtr= resultData;
+  transIdAI->transId[0]= sig1;
+  transIdAI->transId[1]= sig2;
+
+  if (likely(connectedToNode))
+  {
+    sendSignal(resultRef, GSN_TRANSID_AI, signal, 3, JBB, ptr, 1);
+  }
+  else
+  {
+    jam();
+    if (outBuf == signal->theData + 3)
+    {
+      jam();
+      /**
+       * TUP guesses that it can EXECUTE_DIRECT if own-node,
+       *  it then puts outBuf == signal->theData+3
+       */
+      memmove(signal->theData+25, signal->theData+3, 4*len);
+      ptr[0].p = signal->theData+25;
+    }
+    transIdAI->attrData[0] = resultRef;
+    sendSignal(routeRef, GSN_TRANSID_AI_R, signal, 4, JBB, ptr, 1);
+  }
+
+  req_struct->out_buf_index = 0; // Reset buffer
+  req_struct->out_buf_bits = 0;
+}
+
 Uint32
 Dbtup::update_packed(KeyReqStruct *req_struct, const Uint32* inBuf)
 {

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp	2011-01-30 20:56:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp	2011-02-08 14:45:27 +0000
@@ -91,7 +91,8 @@ void Dbtup::storedProcCountNonAPI(BlockR
   if (apiBlockno < MIN_API_BLOCK_NO) {
     ndbassert(blockToMain(apiBlockno) == BACKUP ||
               blockToMain(apiBlockno) == SUMA ||
-              blockToMain(apiBlockno) == DBLQH);
+              blockToMain(apiBlockno) == DBLQH ||
+              blockToMain(apiBlockno) == DBSPJ);
     if (add_del == +1) {
       jam();
       c_storedProcCountNonAPI++;


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20110208144527-zdncdnlktun3p6o0.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:4183) Jonas Oreland8 Feb