List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 4 2010 11:07am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:3824)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped

 3824 Jonas Oreland	2010-10-04
      ndb - make Backup and Suma send long-scan-fragreq, and not use ScanFragReq::setAttrLen (which is redundant)

    modified:
      storage/ndb/include/ndb_version.h.in
      storage/ndb/src/kernel/blocks/backup/Backup.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
=== modified file 'storage/ndb/include/ndb_version.h.in'
--- a/storage/ndb/include/ndb_version.h.in	2010-09-29 08:45:11 +0000
+++ b/storage/ndb/include/ndb_version.h.in	2010-10-04 11:07:50 +0000
@@ -500,4 +500,11 @@ ndbd_suma_stop_me(Uint32 x)
   }
 }
 
+/**
+ * After this version, TC/BACKUP/SUMA does not use ScanFragReq::setAttrLen
+ *   when sending long SCAN_FRAGREQ
+ */
+#define NDBD_LONG_SCAN_FRAGREQ_70 NDB_MAKE_VERSION(7,0,20)
+#define NDBD_LONG_SCAN_FRAGREQ_71 NDB_MAKE_VERSION(7,1,9)
+
 #endif

=== modified file 'storage/ndb/src/kernel/blocks/backup/Backup.cpp'
--- a/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2010-08-17 11:47:55 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2010-10-04 11:07:50 +0000
@@ -4092,7 +4092,6 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* 
     ScanFragReq::setLockMode(req->requestInfo, 0);
     ScanFragReq::setHoldLockFlag(req->requestInfo, 0);
     ScanFragReq::setKeyinfoFlag(req->requestInfo, 0);
-    ScanFragReq::setAttrLen(req->requestInfo, attrLen);
     ScanFragReq::setTupScanFlag(req->requestInfo, 1);
     if (ptr.p->is_lcp())
     {
@@ -4113,25 +4112,19 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* 
       ndbrequire(instanceKey != 0);
       lqhRef = numberToRef(DBLQH, instanceKey, getOwnNodeId());
     }
+
+    Uint32 attrInfo[25];
+    attrInfo[0] = table.attrInfoLen;
+    attrInfo[1] = 0;
+    attrInfo[2] = 0;
+    attrInfo[3] = 0;
+    attrInfo[4] = 0;
+    memcpy(attrInfo + 5, table.attrInfo, 4*table.attrInfoLen);
+    LinearSectionPtr ptr[3];
+    ptr[0].p = attrInfo;
+    ptr[0].sz = 5 + table.attrInfoLen;
     sendSignal(lqhRef, GSN_SCAN_FRAGREQ, signal,
-               ScanFragReq::SignalLength, JBB);
-    
-    signal->theData[0] = filePtr.i;
-    signal->theData[1] = 0;
-    signal->theData[2] = (BACKUP << 20) + (getOwnNodeId() << 8);
-    
-    // Return all
-    signal->theData[3] = table.attrInfoLen;
-    signal->theData[4] = 0;
-    signal->theData[5] = 0;
-    signal->theData[6] = 0;
-    signal->theData[7] = 0;
-    
-    Uint32 dataPos = 8;
-    memcpy(signal->theData + dataPos, table.attrInfo, 4*table.attrInfoLen);
-    dataPos += table.attrInfoLen;
-    ndbassert(dataPos < 25);
-    sendSignal(lqhRef, GSN_ATTRINFO, signal, dataPos, JBB);
+               ScanFragReq::SignalLength, JBB, ptr, 1);
   }
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2010-08-31 10:55:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2010-10-04 11:07:50 +0000
@@ -10198,7 +10198,6 @@ Dbtc::initScanrec(ScanRecordPtr scanptr,
   ScanFragReq::setRangeScanFlag(tmp, ScanTabReq::getRangeScanFlag(ri));
   ScanFragReq::setDescendingFlag(tmp, ScanTabReq::getDescendingFlag(ri));
   ScanFragReq::setTupScanFlag(tmp, ScanTabReq::getTupScanFlag(ri));
-  ScanFragReq::setAttrLen(tmp, aiLength);
   ScanFragReq::setNoDiskFlag(tmp, ScanTabReq::getNoDiskFlag(ri));
   
   scanptr.p->scanRequestInfo = tmp;
@@ -11361,7 +11360,6 @@ void Dbtc::sendScanFragReq(Signal* signa
   ScanFragReq * const req = (ScanFragReq *)&signal->theData[0];
   Uint32 requestInfo = scanP->scanRequestInfo;
   ScanFragReq::setScanPrio(requestInfo, 1);
-  ScanFragReq::setAttrLen(requestInfo, reqAttrLen);
   apiConnectptr.i = scanP->scanApiRec;
   req->tableId = scanP->scanTableref;
   req->schemaVersion = scanP->scanSchemaVersion;
@@ -11451,6 +11449,7 @@ void Dbtc::sendScanFragReq(Signal* signa
     /* Short SCANFRAGREQ with separate KeyInfo and AttrInfo trains 
      * Sent to older NDBD nodes during upgrade
      */
+    ScanFragReq::setAttrLen(requestInfo, reqAttrLen);
     sendSignal(scanFragP->lqhBlockref, GSN_SCAN_FRAGREQ, signal,
                ScanFragReq::SignalLength, JBB);
     if(scanP->scanKeyLen > 0)

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-09-29 07:39:42 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-10-04 11:07:50 +0000
@@ -2512,7 +2512,6 @@ Suma::SyncRecord::nextScan(Signal* signa
   ScanFragReq::setLockMode(req->requestInfo, 0);
   ScanFragReq::setHoldLockFlag(req->requestInfo, 1);
   ScanFragReq::setKeyinfoFlag(req->requestInfo, 0);
-  ScanFragReq::setAttrLen(req->requestInfo, attrLen);
   if (m_requestInfo & SubSyncReq::LM_Exclusive)
   {
     ScanFragReq::setLockMode(req->requestInfo, 1);
@@ -2533,32 +2532,25 @@ Suma::SyncRecord::nextScan(Signal* signa
   req->batch_size_rows= parallelism;
 
   req->batch_size_bytes= 0;
-  suma.sendSignal(lqhRef, GSN_SCAN_FRAGREQ, signal, 
-		  ScanFragReq::SignalLength, JBB);
-  
-  signal->theData[0] = ptrI;
-  signal->theData[1] = 0;
-  signal->theData[2] = (SUMA << 20) + (suma.getOwnNodeId() << 8);
-  
-  // Return all
-  signal->theData[3] = attrBuf.getSize();
-  signal->theData[4] = 0;
-  signal->theData[5] = 0;
-  signal->theData[6] = 0;
-  signal->theData[7] = 0;
+
+  Uint32 * attrInfo = signal->theData + 25;
+  attrInfo[0] = attrBuf.getSize();
+  attrInfo[1] = 0;
+  attrInfo[2] = 0;
+  attrInfo[3] = 0;
+  attrInfo[4] = 0;
   
-  Uint32 dataPos = 8;
+  Uint32 pos = 5;
   DataBuffer<15>::DataBufferIterator it;
-  for(attrBuf.first(it); !it.curr.isNull(); attrBuf.next(it)){
-    AttributeHeader::init(&signal->theData[dataPos++], * it.data, 0);
-    if(dataPos == 25){
-      suma.sendSignal(lqhRef, GSN_ATTRINFO, signal, 25, JBB);
-      dataPos = 3;
-    }
-  }
-  if(dataPos != 3){
-    suma.sendSignal(lqhRef, GSN_ATTRINFO, signal, dataPos, JBB);
+  for(attrBuf.first(it); !it.curr.isNull(); attrBuf.next(it))
+  {
+    AttributeHeader::init(&attrInfo[pos++], * it.data, 0);
   }
+  LinearSectionPtr ptr[3];
+  ptr[0].p = attrInfo;
+  ptr[0].sz = pos;
+  suma.sendSignal(lqhRef, GSN_SCAN_FRAGREQ, signal, 
+		  ScanFragReq::SignalLength, JBB, ptr, 1);
   
   m_currentNoOfAttributes = attrBuf.getSize();        
 


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101004110750-ujczhdj2y7mjii0c.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:3824) Jonas Oreland4 Oct