MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:May 28 2009 12:52pm
Subject:bzr commit into mysql-5.1-telco-6.3 branch (jonas:2980)
View as plain text  
#At file:///home/jonas/src/telco-6.3/ based on revid:jonas@stripped

 2980 Jonas Oreland	2009-05-28 [merge]
      merge 62 to 63

    modified:
      storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
      storage/ndb/test/ndbapi/testSystemRestart.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp	2009-05-26 18:53:34 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp	2009-05-28 12:43:04 +0000
@@ -1831,15 +1831,17 @@ Dbtup::disk_restart_alloc_extent(Uint32 
   if (tabPtr.p->tableStatus == DEFINED)
   {
     getFragmentrec(fragPtr, fragId, tabPtr.p);
-    if (fragPtr.p->m_undo_complete & Fragrecord::UC_CREATE)
-    {
-      jam();
-      return -1;
-    }
 
     if (!fragPtr.isNull())
     {
       jam();
+
+      if (fragPtr.p->m_undo_complete & Fragrecord::UC_CREATE)
+      {
+        jam();
+        return -1;
+      }
+
       Disk_alloc_info& alloc= fragPtr.p->m_disk_alloc_info;
       
       Ptr<Extent_info> ext;

=== modified file 'storage/ndb/test/ndbapi/testSystemRestart.cpp'
--- a/storage/ndb/test/ndbapi/testSystemRestart.cpp	2009-05-27 12:11:46 +0000
+++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp	2009-05-28 12:51:47 +0000
@@ -1753,6 +1753,85 @@ runTO(NDBT_Context* ctx, NDBT_Step* step
   return result;
 }
 
+int runBug45154(NDBT_Context* ctx, NDBT_Step* step)
+{
+  Ndb* pNdb = GETNDB(step);
+  NdbDictionary::Dictionary * pDict = pNdb->getDictionary();
+  int result = NDBT_OK;
+  Uint32 loops = ctx->getNumLoops();
+  Uint32 rows = ctx->getNumRecords();
+  NdbRestarter restarter;
+
+  restarter.getNumDbNodes();
+  int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_CHECKPOINT, 0 };
+  NdbLogEventHandle handle =
+    ndb_mgm_create_logevent_handle(restarter.handle, filter);
+
+  struct ndb_logevent event;
+
+  Uint16 frag_data[128];
+  bzero(frag_data, sizeof(frag_data));
+
+  for(Uint32 i = 0; i < loops && result != NDBT_FAILED; i++)
+  {
+    ndbout_c("loop %u", i);
+
+    NdbDictionary::Table copy = *ctx->getTab();
+    copy.setName("BUG_45154");
+    copy.setFragmentType(NdbDictionary::Object::DistrKeyLin);
+    copy.setFragmentCount(2 * restarter.getNumDbNodes());
+    copy.setFragmentData(frag_data, 4*restarter.getNumDbNodes());
+    pDict->dropTable("BUG_45154");
+    int res = pDict->createTable(copy);
+    if (res != 0)
+    {
+      ndbout << pDict->getNdbError() << endl;
+      return NDBT_FAILED;
+    }
+    const NdbDictionary::Table* copyptr= pDict->getTable("BUG_45154");
+
+    {
+      HugoTransactions hugoTrans(*copyptr);
+      hugoTrans.loadTable(pNdb, rows);
+    }
+
+    int dump[] = { DumpStateOrd::DihStartLcpImmediately };
+    for (int l = 0; l<2; l++)
+    {
+      CHECK(restarter.dumpStateAllNodes(dump, 1) == 0);
+      while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
+            event.type != NDB_LE_LocalCheckpointStarted);
+      while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
+            event.type != NDB_LE_LocalCheckpointCompleted);
+    }
+
+    pDict->dropTable("BUG_45154");
+    copy.setFragmentCount(restarter.getNumDbNodes());
+    copy.setFragmentData(frag_data, 2*restarter.getNumDbNodes());
+    res = pDict->createTable(copy);
+    if (res != 0)
+    {
+      ndbout << pDict->getNdbError() << endl;
+      return NDBT_FAILED;
+    }
+    copyptr = pDict->getTable("BUG_45154");
+
+    {
+      HugoTransactions hugoTrans(*copyptr);
+      hugoTrans.loadTable(pNdb, rows);
+    }
+    restarter.restartAll(false, true, true);
+    restarter.waitClusterNoStart();
+    restarter.startAll();
+    restarter.waitClusterStarted();
+
+    pDict->dropTable("BUG_45154");
+  }
+
+  ctx->stopTest();
+  return result;
+}
+
 NDBT_TESTSUITE(testSystemRestart);
 TESTCASE("SR1", 
 	 "Basic system restart test. Focus on testing restart from REDO log.\n"
@@ -2048,6 +2127,10 @@ TESTCASE("Bug41915", "")
   STEP(runSR_DD_2);
   FINALIZER(runClearTable);
 }
+TESTCASE("Bug45154", "")
+{
+  INITIALIZER(runBug45154);
+}
 NDBT_TESTSUITE_END(testSystemRestart);
 
 int main(int argc, const char** argv){


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20090528125147-o9l1gj8oc7qee7uy.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (jonas:2980)Jonas Oreland28 May