List:Commits« Previous MessageNext Message »
From:jonas oreland Date:April 21 2011 9:21am
Subject:bzr push into mysql-5.1-telco-7.0 branch (jonas:4330 to 4332) Bug#60943
View as plain text  
 4332 jonas oreland	2011-04-21
      ndb - bug#60943 - fix various problems found when running 32-node ndbmtd cluster

    modified:
      storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp
      storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
      storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp
 4331 jonas oreland	2011-04-21 [merge]
      ndb - merge 63 to 70

    added:
      storage/ndb/test/run-test/conf-blade08.cnf
    modified:
      storage/ndb/test/run-test/Makefile.am
 4330 jonas oreland	2011-04-21
      ndb - cleanup changemask handling in tup by introducing a real type, instead of juggling Uint32*

    modified:
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp	2011-04-15 13:52:53 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp	2011-04-21 09:21:18 +0000
@@ -504,12 +504,12 @@ public:
     Method method;
     Storage tabStorage;
 
-    Uint32 pageRef[8];
+    Uint32 pageRef[32];
 //-----------------------------------------------------------------------------
 // Each entry in this array contains a reference to 16 fragment records in a
 // row. Thus finding the correct record is very quick provided the fragment id.
 //-----------------------------------------------------------------------------
-    Uint32 startFid[MAX_NDB_NODES];
+    Uint32 startFid[MAX_NDB_NODES * MAX_FRAG_PER_NODE / NO_OF_FRAGS_PER_CHUNK];
 
     Uint32 tabFile[2];
     Uint32 connectrec;                                    

=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-04-15 13:52:53 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-04-21 09:21:18 +0000
@@ -8768,6 +8768,7 @@ Dbdih::add_fragment_to_table(Ptr<TabReco
   ndbrequire(cremainingfrags >= NO_OF_FRAGS_PER_CHUNK);
   cremainingfrags -= NO_OF_FRAGS_PER_CHUNK;
 
+  ndbrequire(chunks < NDB_ARRAY_SIZE(tabPtr.p->startFid));
   tabPtr.p->startFid[chunks] = fragPtr.i;
   for (Uint32 i = 0; i<NO_OF_FRAGS_PER_CHUNK; i++)
   {
@@ -9128,7 +9129,7 @@ Dbdih::getFragstore(TabRecord * tab,    
   Uint32 chunkNo = fragNo >> LOG_NO_OF_FRAGS_PER_CHUNK;
   Uint32 chunkIndex = fragNo & (NO_OF_FRAGS_PER_CHUNK - 1);
   fragPtr.i = tab->startFid[chunkNo] + chunkIndex;
-  if (likely(chunkNo < MAX_NDB_NODES)) {
+  if (likely(chunkNo < NDB_ARRAY_SIZE(tab->startFid))) {
     ptrCheckGuard(fragPtr, TfragstoreFileSize, TfragStore);
     fragptr = fragPtr;
     return;
@@ -9144,6 +9145,7 @@ void Dbdih::allocFragments(Uint32 noOfFr
   for (Uint32 i = 0; i < noOfChunks; i++) {
     jam();
     Uint32 baseFrag = cfirstfragstore;
+    ndbrequire(i < NDB_ARRAY_SIZE(tabPtr.p->startFid));
     tabPtr.p->startFid[i] = baseFrag;
     fragPtr.i = baseFrag;
     ptrCheckGuard(fragPtr, cfragstoreFileSize, fragmentstore);
@@ -9164,6 +9166,7 @@ void Dbdih::releaseFragments(TabRecordPt
   FragmentstorePtr fragPtr;
   for (Uint32 i = 0; i < tabPtr.p->noOfFragChunks; i++) {
     jam();
+    ndbrequire(i < NDB_ARRAY_SIZE(tabPtr.p->startFid));
     Uint32 baseFrag = tabPtr.p->startFid[i];
     fragPtr.i = baseFrag;
     ptrCheckGuard(fragPtr, cfragstoreFileSize, fragmentstore);
@@ -11042,7 +11045,7 @@ void Dbdih::readingTableLab(Signal* sign
   Uint32 noOfStoredPages = pagePtr.p->word[33];
   if (tabPtr.p->noPages < noOfStoredPages) {
     jam();
-    ndbrequire(noOfStoredPages <= 8);
+    ndbrequire(noOfStoredPages <= NDB_ARRAY_SIZE(tabPtr.p->pageRef));
     for (Uint32 i = tabPtr.p->noPages; i < noOfStoredPages; i++) {
       jam();
       allocpage(pagePtr);
@@ -11547,7 +11550,7 @@ void Dbdih::readingTableErrorLab(Signal*
   /* ---------------------------------------------------------------------- */
   /*    READING THIS FILE FAILED. CLOSE IT AFTER RELEASING ALL PAGES.       */
   /* ---------------------------------------------------------------------- */
-  ndbrequire(tabPtr.p->noPages <= 8);
+  ndbrequire(tabPtr.p->noPages <= NDB_ARRAY_SIZE(tabPtr.p->pageRef));
   for (Uint32 i = 0; i < tabPtr.p->noPages; i++) {
     jam();
     releasePage(tabPtr.p->pageRef[i]);
@@ -11596,7 +11599,7 @@ void Dbdih::execCOPY_TABREQ(Signal* sign
     tabPtr.p->schemaVersion = schemaVersion;
     initTableFile(tabPtr);
   }//if
-  ndbrequire(tabPtr.p->noPages < 8);
+  ndbrequire(tabPtr.p->noPages < NDB_ARRAY_SIZE(tabPtr.p->pageRef));
   if (tabPtr.p->noOfWords == 0) {
     jam();
     allocpage(pagePtr);
@@ -11689,7 +11692,7 @@ void Dbdih::readPagesIntoTableLab(Signal
 
 void Dbdih::readPagesIntoFragLab(Signal* signal, RWFragment* rf) 
 {
-  ndbrequire(rf->pageIndex < 8);
+  ndbrequire(rf->pageIndex < NDB_ARRAY_SIZE(rf->rwfTabPtr.p->pageRef));
   rf->rwfPageptr.i = rf->rwfTabPtr.p->pageRef[rf->pageIndex];
   ptrCheckGuard(rf->rwfPageptr, cpageFileSize, pageRecord);
   FragmentstorePtr fragPtr;
@@ -11799,7 +11802,7 @@ void Dbdih::packTableIntoPagesLab(Signal
 /*****************************************************************************/
 void Dbdih::packFragIntoPagesLab(Signal* signal, RWFragment* wf) 
 {
-  ndbrequire(wf->pageIndex < 8);
+  ndbrequire(wf->pageIndex < NDB_ARRAY_SIZE(wf->rwfTabPtr.p->pageRef));
   wf->rwfPageptr.i = wf->rwfTabPtr.p->pageRef[wf->pageIndex];
   ptrCheckGuard(wf->rwfPageptr, cpageFileSize, pageRecord);
   FragmentstorePtr fragPtr;
@@ -12411,7 +12414,7 @@ void Dbdih::copyTableNode(Signal* signal
       return;
     }//if
   }//if
-  ndbrequire(ctn->pageIndex < 8);
+  ndbrequire(ctn->pageIndex < NDB_ARRAY_SIZE(ctn->ctnTabPtr.p->pageRef));
   ctn->ctnPageptr.i = ctn->ctnTabPtr.p->pageRef[ctn->pageIndex];
   ptrCheckGuard(ctn->ctnPageptr, cpageFileSize, pageRecord);
   /**
@@ -12456,7 +12459,7 @@ void Dbdih::copyTableNode(Signal* signal
         jam();
         ctn->wordIndex = 0;
         ctn->pageIndex++;
-        ndbrequire(ctn->pageIndex < 8);
+        ndbrequire(ctn->pageIndex < NDB_ARRAY_SIZE(ctn->ctnTabPtr.p->pageRef));
         ctn->ctnPageptr.i = ctn->ctnTabPtr.p->pageRef[ctn->pageIndex];
         ptrCheckGuard(ctn->ctnPageptr, cpageFileSize, pageRecord);
       }//if
@@ -15345,10 +15348,10 @@ void Dbdih::initTable(TabRecordPtr tabPt
   tabPtr.p->m_dropTab.tabUserRef = 0;
   tabPtr.p->m_dropTab.tabUserPtr = RNIL;
   Uint32 i;
-  for (i = 0; i < MAX_NDB_NODES; i++) {
+  for (i = 0; i < NDB_ARRAY_SIZE(tabPtr.p->startFid); i++) {
     tabPtr.p->startFid[i] = RNIL;
   }//for
-  for (i = 0; i < 8; i++) {
+  for (i = 0; i < NDB_ARRAY_SIZE(tabPtr.p->pageRef); i++) {
     tabPtr.p->pageRef[i] = RNIL;
   }//for
   tabPtr.p->tableType = DictTabInfo::UndefTableType;
@@ -16215,7 +16218,7 @@ Uint32 Dbdih::readPageWord(RWFragment* r
     jam();
     ndbrequire(rf->wordIndex == 2048);
     rf->pageIndex++;
-    ndbrequire(rf->pageIndex < 8);
+    ndbrequire(rf->pageIndex < NDB_ARRAY_SIZE(rf->rwfTabPtr.p->pageRef));
     rf->rwfPageptr.i = rf->rwfTabPtr.p->pageRef[rf->pageIndex];
     ptrCheckGuard(rf->rwfPageptr, cpageFileSize, pageRecord);
     rf->wordIndex = 32;
@@ -16304,11 +16307,16 @@ void Dbdih::readTabfile(Signal* signal, 
   signal->theData[3] = ZLIST_OF_PAIRS;
   signal->theData[4] = ZVAR_NO_WORD;
   signal->theData[5] = tab->noPages;
-  for (Uint32 i = 0; i < tab->noPages; i++) {
-    signal->theData[6 + (2 * i)] = tab->pageRef[i];
-    signal->theData[7 + (2 * i)] = i;
-  }//for
-  sendSignal(NDBFS_REF, GSN_FSREADREQ, signal, 22, JBA);
+  Uint32 section[2 * NDB_ARRAY_SIZE(tab->pageRef)];
+  for (Uint32 i = 0; i < tab->noPages; i++)
+  {
+    section[(2 * i) + 0] = tab->pageRef[i];
+    section[(2 * i) + 1] = i;
+  }
+  LinearSectionPtr ptr[3];
+  ptr[0].p = section;
+  ptr[0].sz = 2 * tab->noPages;
+  sendSignal(NDBFS_REF, GSN_FSREADREQ, signal, 6, JBA, ptr, 1);
 }//Dbdih::readTabfile()
 
 void Dbdih::releasePage(Uint32 pageIndex)
@@ -16325,7 +16333,7 @@ void Dbdih::releaseTabPages(Uint32 table
   TabRecordPtr tabPtr;
   tabPtr.i = tableId;
   ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
-  ndbrequire(tabPtr.p->noPages <= 8);
+  ndbrequire(tabPtr.p->noPages <= NDB_ARRAY_SIZE(tabPtr.p->pageRef));
   for (Uint32 i = 0; i < tabPtr.p->noPages; i++) {
     jam();
     releasePage(tabPtr.p->pageRef[i]);
@@ -17102,7 +17110,7 @@ void Dbdih::writePageWord(RWFragment* wf
     allocpage(wf->rwfPageptr);
     wf->wordIndex = 32;
     wf->pageIndex++;
-    ndbrequire(wf->pageIndex < 8);
+    ndbrequire(wf->pageIndex < NDB_ARRAY_SIZE(wf->rwfTabPtr.p->pageRef));
     wf->rwfTabPtr.p->pageRef[wf->pageIndex] = wf->rwfPageptr.i;
     wf->rwfTabPtr.p->noPages++;
   }//if
@@ -17173,13 +17181,17 @@ void Dbdih::writeTabfile(Signal* signal,
   signal->theData[3] = ZLIST_OF_PAIRS_SYNCH;
   signal->theData[4] = ZVAR_NO_WORD;
   signal->theData[5] = tab->noPages;
-  for (Uint32 i = 0; i < tab->noPages; i++) {
-    jam();
-    signal->theData[6 + (2 * i)] = tab->pageRef[i];
-    signal->theData[7 + (2 * i)] = i;
-  }//for
-  Uint32 length = 6 + (2 * tab->noPages);
-  sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, length, JBA);
+
+  Uint32 section[2 * NDB_ARRAY_SIZE(tab->pageRef)];
+  for (Uint32 i = 0; i < tab->noPages; i++)
+  {
+    section[(2 * i) + 0] = tab->pageRef[i];
+    section[(2 * i) + 1] = i;
+  }
+  LinearSectionPtr ptr[3];
+  ptr[0].p = section;
+  ptr[0].sz = 2 * tab->noPages;
+  sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, 6, JBA, ptr, 1);
 }//Dbdih::writeTabfile()
 
 void Dbdih::execDEBUG_SIG(Signal* signal) 

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp	2011-04-21 09:21:18 +0000
@@ -80,7 +80,7 @@ public:
 	char *buf;
 	size_t size;
 	off_t offset;
-      } pages[16];
+      } pages[32];
     } readWrite;
     struct {
       const char * buf;

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp	2011-04-06 12:49:06 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp	2011-04-21 09:21:18 +0000
@@ -548,7 +548,19 @@ Ndbfs::execFSCLOSEREQ(Signal * signal)
 void 
 Ndbfs::readWriteRequest(int action, Signal * signal)
 {
-  const FsReadWriteReq * const fsRWReq = (FsReadWriteReq *)&signal->theData[0];
+  Uint32 theData[25 + 2 * 32];
+  memcpy(theData, signal->theData, 4 * signal->getLength());
+  SectionHandle handle(this, signal);
+  if (handle.m_cnt > 0)
+  {
+    SegmentedSectionPtr secPtr;
+    ndbrequire(handle.getSection(secPtr, 0));
+    ndbrequire(signal->getLength() + secPtr.sz < NDB_ARRAY_SIZE(theData));
+    copy(theData + signal->getLength(), secPtr);
+    releaseSections(handle);
+  }
+
+  const FsReadWriteReq * const fsRWReq = (FsReadWriteReq *)theData;
   Uint16 filePointer =  (Uint16)fsRWReq->filePointer;
   const UintR userPointer = fsRWReq->userPointer; 
   const BlockReference userRef = fsRWReq->userReference;

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp	2011-04-21 09:21:18 +0000
@@ -163,6 +163,9 @@ VoidFs::execFSWRITEREQ(Signal* signal)
   const Uint32 userRef = req->userReference;
   const Uint32 userPointer = req->userPointer;
 
+  SectionHandle handle(this, signal);
+  releaseSections(handle);
+
   signal->theData[0] = userPointer;
   sendSignal(userRef, GSN_FSWRITECONF, signal, 1, JBB);
 }
@@ -176,6 +179,9 @@ VoidFs::execFSREADREQ(Signal* signal)
   const Uint32 userRef = req->userReference;
   const Uint32 userPointer = req->userPointer;
 
+  SectionHandle handle(this, signal);
+  releaseSections(handle);
+
   signal->theData[0] = userPointer;
   sendSignal(userRef, GSN_FSREADCONF, signal, 1, JBB);
 #if 0

=== modified file 'storage/ndb/test/run-test/Makefile.am'
--- a/storage/ndb/test/run-test/Makefile.am	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/run-test/Makefile.am	2011-04-21 05:41:24 +0000
@@ -26,7 +26,9 @@ test_DATA=daily-basic-tests.txt daily-de
           conf-ndbmaster.cnf \
           conf-fimafeng08.cnf conf-dl145a.cnf test-tests.txt conf-test.cnf \
           conf-upgrade.cnf upgrade-tests.txt \
-	  conf-ndb07.cnf conf-fimafeng09.cnf conf-tyr64.cnf conf-techra29.cnf
+	  conf-ndb07.cnf \
+	  conf-fimafeng09.cnf conf-tyr64.cnf conf-techra29.cnf \
+	  conf-blade08.cnf
 
 test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \
           autotest-run.sh atrt-backtrace.sh

=== added file 'storage/ndb/test/run-test/conf-blade08.cnf'
--- a/storage/ndb/test/run-test/conf-blade08.cnf	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/run-test/conf-blade08.cnf	2011-04-20 09:18:09 +0000
@@ -0,0 +1,32 @@
+[atrt]
+basedir = CHOOSE_dir
+baseport = 14000
+clusters = .2node
+
+[ndb_mgmd]
+
+[mysqld]
+skip-innodb
+skip-bdb
+
+[cluster_config.2node]
+ndb_mgmd = CHOOSE_host1
+ndbd = CHOOSE_host2,CHOOSE_host3
+ndbapi= CHOOSE_host1,CHOOSE_host1,CHOOSE_host1
+
+NoOfReplicas = 2
+IndexMemory = 100M 
+DataMemory = 300M
+BackupMemory = 64M
+MaxNoOfConcurrentScans = 100
+MaxNoOfSavedMessages= 1000
+SendBufferMemory = 2M
+NoOfFragmentLogFiles = 4
+FragmentLogFileSize = 64M
+CompressedLCP=1
+CompressedBackup=1
+ODirect=1
+
+SharedGlobalMemory=256M
+InitialLogfileGroup=undo_buffer_size=64M;undofile01.dat:256M;undofile02.dat:128M
+InitialTablespace=datafile01.dat:128M;datafile02.dat:64M

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (jonas:4330 to 4332) Bug#60943jonas oreland21 Apr