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

 3834 Jonas Oreland	2010-10-06
      ndb - another fix of sending short scanfragreq (discovered by "testScan -n Bug54945")

    modified:
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2010-10-05 10:02:43 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2010-10-06 07:14:56 +0000
@@ -11348,15 +11348,34 @@ void Dbtc::sendScanFragReq(Signal* signa
   bool longFragReq= ((version >= NDBD_LONG_SCANFRAGREQ) &&
                      (! ERROR_INSERTED(8070) &&
 		      ! ERROR_INSERTED(8088)));
-  Uint32 reqKeyLen= 0;
-  Uint32 reqAttrLen= 0;
-  if (unlikely(! longFragReq))
-  {
-    reqKeyLen= scanP->scanKeyLen;
-    reqAttrLen= scanP->scanAiLength;
-  }
   cachePtr.i = apiConnectptr.p->cachePtr;
   ptrCheckGuard(cachePtr, ccacheFilesize, cacheRecord);
+
+  Uint32 reqKeyLen = scanP->scanKeyLen;
+
+  SectionHandle sections(this);
+  sections.m_ptr[0].i = cachePtr.p->attrInfoSectionI;
+  sections.m_cnt = 1;
+    
+  if (reqKeyLen > 0)
+  {
+    jam();
+    ndbassert(cachePtr.p->keyInfoSectionI != RNIL);
+    sections.m_ptr[1].i = cachePtr.p->keyInfoSectionI;
+    sections.m_cnt = 2;
+  }
+
+  if (isLastReq)
+  {
+    /* This send will release these sections, remove our
+     * references to them
+     */
+    cachePtr.p->attrInfoSectionI = RNIL;
+    cachePtr.p->keyInfoSectionI = RNIL;
+  }
+    
+  getSections(sections.m_cnt, sections.m_ptr);
+
   ScanFragReq * const req = (ScanFragReq *)&signal->theData[0];
   Uint32 requestInfo = scanP->scanRequestInfo;
   ScanFragReq::setScanPrio(requestInfo, 1);
@@ -11379,29 +11398,6 @@ void Dbtc::sendScanFragReq(Signal* signa
   {
     jam();
     /* Send long, possibly fragmented SCAN_FRAGREQ */
-    /* Create SectionHandle */
-    SectionHandle sections(this);
-    sections.m_ptr[0].i= cachePtr.p->attrInfoSectionI;
-    sections.m_cnt= 1;
-    
-    if (scanP->scanKeyLen > 0)
-    {
-      jam();
-      ndbassert(cachePtr.p->keyInfoSectionI != RNIL);
-      sections.m_ptr[1].i= cachePtr.p->keyInfoSectionI;
-      sections.m_cnt= 2;
-    }
-
-    if (isLastReq)
-    {
-      /* This send will release these sections, remove our
-       * references to them
-       */
-      cachePtr.p->attrInfoSectionI= RNIL;
-      cachePtr.p->keyInfoSectionI= RNIL;
-    }
-    
-    getSections(sections.m_cnt, sections.m_ptr);
 
     // TODO : 
     //   1) Consider whether to adjust fragmentation threshold
@@ -11449,10 +11445,11 @@ void Dbtc::sendScanFragReq(Signal* signa
     /* Short SCANFRAGREQ with separate KeyInfo and AttrInfo trains 
      * Sent to older NDBD nodes during upgrade
      */
+    Uint32 reqAttrLen = sections.m_ptr[0].sz;
     ScanFragReq::setAttrLen(req->requestInfo, reqAttrLen);
     sendSignal(scanFragP->lqhBlockref, GSN_SCAN_FRAGREQ, signal,
                ScanFragReq::SignalLength, JBB);
-    if(scanP->scanKeyLen > 0)
+    if(reqKeyLen > 0)
     {
       jam();
       tcConnectptr.i = scanFragptr.i;
@@ -11461,7 +11458,7 @@ void Dbtc::sendScanFragReq(Signal* signa
                        scanFragP->lqhBlockref,
                        scanFragptr.i,
                        0, // Offset 0
-                       cachePtr.p->keyInfoSectionI);
+                       sections.m_ptr[1].i);
     }
     
     if(ERROR_INSERTED(8035))
@@ -11473,19 +11470,20 @@ void Dbtc::sendScanFragReq(Signal* signa
                                    scanFragP->lqhBlockref,
                                    scanFragptr.i,
                                    0, // Offset 0
-                                   cachePtr.p->attrInfoSectionI));
+                                   sections.m_ptr[0].i));
     }
-
+        
     if(ERROR_INSERTED(8035))
       globalTransporterRegistry.performSend();
 
     if (isLastReq)
     {
       /* Free the sections here */
-      releaseSection(cachePtr.p->attrInfoSectionI);
-      releaseSection(cachePtr.p->keyInfoSectionI);
-      cachePtr.p->attrInfoSectionI= RNIL;
-      cachePtr.p->keyInfoSectionI= RNIL;
+      releaseSections(sections);
+    }
+    else
+    {
+      sections.clear();
     }
   }
 


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101006071456-491ciphcumesgc20.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:3834) Jonas Oreland6 Oct