List:Internals« Previous MessageNext Message »
From:jonas.oreland Date:April 25 2005 9:59am
Subject:bk commit into 4.1 tree (joreland:1.2207) BUG#9749
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2207 05/04/25 11:59:00 joreland@stripped +2 -0
  bug#9749 - ndb lock upgrade 
    post review fix.
    don't init hash value on restart operations
    make sure that lock mode is correct in entire que.

  ndb/test/ndbapi/testOperations.cpp
    1.11 05/04/25 11:58:58 joreland@stripped +12 -4
    Test case also for abort case.
      (abort if not lock owner still fails!)

  ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
    1.31 05/04/25 11:58:58 joreland@stripped +6 -7
    bug#9749 - ndb lock upgrade 
      post review fix.
      don't init hash value on restart operations
      make sure that lock mode is correct in entire que.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	joreland
# Host:	eel.hemma.oreland.se.ndb.mysql.com
# Root:	/home/jonas/src/mysql-4.1

--- 1.30/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	Thu Apr 14 13:43:05 2005
+++ 1.31/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	Mon Apr 25 11:58:58 2005
@@ -5899,33 +5899,32 @@
   
   // Find end of parallell que
   tmp = lock_owner;
+  Uint32 lockMode = next.p->lockMode > lock_owner.p->lockMode ?
+    next.p->lockMode : lock_owner.p->lockMode;
   while(tmp.p->nextParallelQue != RNIL)
   {
     jam();
     tmp.i = tmp.p->nextParallelQue;
+    tmp.p->lockMode = lockMode;
     ptrCheckGuard(tmp, coprecsize, operationrec);
   }
+  tmp.p->lockMode = lockMode;
   
   next.p->prevParallelQue = tmp.i;
   tmp.p->nextParallelQue = next.i;
   
   OperationrecPtr save = operationRecPtr;
-  Uint32 lockMode = lock_owner.p->lockMode;
 
-  Uint32 TelementIsDisappeared = 0; // lock upgrade = all reads
-  Uint32 ThashValue = lock_owner.p->hashValue;
   Uint32 localdata[2];
   localdata[0] = lock_owner.p->localdata[0];
   localdata[1] = lock_owner.p->localdata[1];
   do {
-    next.p->elementIsDisappeared = TelementIsDisappeared;
-    next.p->hashValue = ThashValue;
     next.p->localdata[0] = localdata[0];
     next.p->localdata[1] = localdata[1];
+    next.p->lockMode = lockMode;
     
     operationRecPtr = next;
-    next.p->lockMode = lockMode;
-    TelementIsDisappeared = executeNextOperation(signal);
+    executeNextOperation(signal);
     if (next.p->nextParallelQue != RNIL) 
     {
       jam();

--- 1.10/ndb/test/ndbapi/testOperations.cpp	Tue Apr 12 17:54:32 2005
+++ 1.11/ndb/test/ndbapi/testOperations.cpp	Mon Apr 25 11:58:58 2005
@@ -635,7 +635,14 @@
     ndbout_c("wait 3 - done");
     
     NdbSleep_MilliSleep(200);
-    CHECK(hugoOps.execute_Commit(pNdb) == 0);      
+    if(ctx->getProperty("LU_COMMIT", (Uint32)0) == 0)
+    {
+      CHECK(hugoOps.execute_Commit(pNdb) == 0);
+    }
+    else
+    {
+      CHECK(hugoOps.execute_Rollback(pNdb) == 0);
+    }
   } while(0);
 
   return result;
@@ -650,7 +657,7 @@
 
   NDBT_TestSuite ts("testOperations");
 
-  for(Uint32 i = 0; i <6; i++)
+  for(Uint32 i = 0; i < 12; i++)
   {
     BaseString name("bug_9749");
     name.appfmt("_%d", i);
@@ -658,8 +665,9 @@
 						    name.c_str(), "");    
     
     pt->setProperty("LOCK_UPGRADE", 1 + (i & 1));
-    pt->setProperty("LU_OP", 1 + (i >> 1));
-    
+    pt->setProperty("LU_OP", 1 + ((i >> 1) % 3));
+    pt->setProperty("LU_COMMIT", i / 6);
+
     pt->addInitializer(new NDBT_Initializer(pt,
 					    "runClearTable", 
 					    runClearTable));
Thread
bk commit into 4.1 tree (joreland:1.2207) BUG#9749jonas.oreland25 Apr