MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jonas Date:April 21 2006 12:13pm
Subject:bk commit into 5.1 tree (jonas:1.2377) BUG#18575
View as plain text  
Below is the list of changes that have just been committed into a local
5.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.2377 06/04/21 14:13:19 jonas@stripped +3 -0
  ndb -
    bug#19141, bug#18575
    
    Maek sure global dict lock is taken during create/drop file/filegroup

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
    1.124 06/04/21 14:13:16 jonas@stripped +2 -2
    Fix not master for create/drop file

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
    1.86 06/04/21 14:13:16 jonas@stripped +74 -9
    Fix c_blockState lock for createdrop file/filegroup

  storage/ndb/include/kernel/signaldata/DropFilegroup.hpp
    1.3 06/04/21 14:13:16 jonas@stripped +1 -0
    Fix error code

# 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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/51-work

--- 1.2/storage/ndb/include/kernel/signaldata/DropFilegroup.hpp	2006-04-10 17:06:29 +02:00
+++ 1.3/storage/ndb/include/kernel/signaldata/DropFilegroup.hpp	2006-04-21 14:13:16 +02:00
@@ -150,6 +150,7 @@
   enum ErrorCode {
     NoError = 0,
     Busy = 701,
+    NotMaster = 702,
     NoSuchFile = 766,
     DropUndoFileNotSupported = 769,
     InvalidSchemaObjectVersion = 774

--- 1.85/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-04-10 17:06:29 +02:00
+++ 1.86/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-04-21 14:13:16 +02:00
@@ -13396,6 +13396,24 @@
   Uint32 requestInfo = req->requestInfo;
   
   do {
+    if(getOwnNodeId() != c_masterNodeId){
+      jam();
+      ref->errorCode = CreateFileRef::NotMaster;
+      ref->status    = 0;
+      ref->errorKey  = 0;
+      ref->errorLine = __LINE__;
+      break;
+    }
+    
+    if (c_blockState != BS_IDLE){
+      jam();
+      ref->errorCode = CreateFileRef::Busy;
+      ref->status    = 0;
+      ref->errorKey  = 0;
+      ref->errorLine = __LINE__;
+      break;
+    }
+
     Ptr<SchemaTransaction> trans_ptr;
     if (! c_Trans.seize(trans_ptr)){
       ref->errorCode = CreateFileRef::Busy;
@@ -13455,6 +13473,9 @@
     tmp.init<CreateObjRef>(rg, GSN_CREATE_OBJ_REF, trans_key);
     sendSignal(rg, GSN_CREATE_OBJ_REQ, signal, 
 	       CreateObjReq::SignalLength, JBB);
+
+    c_blockState = BS_CREATE_TAB;
+
     return;
   } while(0);
   
@@ -13480,15 +13501,6 @@
   Uint32 type = req->objType;
   
   do {
-    Ptr<SchemaTransaction> trans_ptr;
-    if (! c_Trans.seize(trans_ptr)){
-      ref->errorCode = CreateFilegroupRef::Busy;
-      ref->status    = 0;
-      ref->errorKey  = 0;
-      ref->errorLine = __LINE__;
-      break;
-    }
-
     if(getOwnNodeId() != c_masterNodeId){
       jam();
       ref->errorCode = CreateFilegroupRef::NotMaster;
@@ -13506,6 +13518,15 @@
       ref->errorLine = __LINE__;
       break;
     }
+
+    Ptr<SchemaTransaction> trans_ptr;
+    if (! c_Trans.seize(trans_ptr)){
+      ref->errorCode = CreateFilegroupRef::Busy;
+      ref->status    = 0;
+      ref->errorKey  = 0;
+      ref->errorLine = __LINE__;
+      break;
+    }
     
     const Uint32 trans_key = ++c_opRecordSequence;
     trans_ptr.p->key = trans_key;
@@ -13554,6 +13575,9 @@
     tmp.init<CreateObjRef>(rg, GSN_CREATE_OBJ_REF, trans_key);
     sendSignal(rg, GSN_CREATE_OBJ_REQ, signal, 
 	       CreateObjReq::SignalLength, JBB);
+
+    c_blockState = BS_CREATE_TAB;
+
     return;
   } while(0);
   
@@ -13581,6 +13605,22 @@
   Uint32 version = req->file_version;
   
   do {
+    if(getOwnNodeId() != c_masterNodeId){
+      jam();
+      ref->errorCode = DropFileRef::NotMaster;
+      ref->errorKey  = 0;
+      ref->errorLine = __LINE__;
+      break;
+    }
+    
+    if (c_blockState != BS_IDLE){
+      jam();
+      ref->errorCode = DropFileRef::Busy;
+      ref->errorKey  = 0;
+      ref->errorLine = __LINE__;
+      break;
+    }
+
     Ptr<File> file_ptr;
     if (!c_file_hash.find(file_ptr, objId))
     {
@@ -13636,6 +13676,9 @@
     tmp.init<CreateObjRef>(rg, GSN_DROP_OBJ_REF, trans_key);
     sendSignal(rg, GSN_DROP_OBJ_REQ, signal, 
 	       DropObjReq::SignalLength, JBB);
+
+    c_blockState = BS_CREATE_TAB;
+
     return;
   } while(0);
   
@@ -13663,6 +13706,22 @@
   Uint32 version = req->filegroup_version;
   
   do {
+    if(getOwnNodeId() != c_masterNodeId){
+      jam();
+      ref->errorCode = DropFilegroupRef::NotMaster;
+      ref->errorKey  = 0;
+      ref->errorLine = __LINE__;
+      break;
+    }
+    
+    if (c_blockState != BS_IDLE){
+      jam();
+      ref->errorCode = DropFilegroupRef::Busy;
+      ref->errorKey  = 0;
+      ref->errorLine = __LINE__;
+      break;
+    }
+    
     Ptr<Filegroup> filegroup_ptr;
     if (!c_filegroup_hash.find(filegroup_ptr, objId))
     {
@@ -13718,6 +13777,9 @@
     tmp.init<CreateObjRef>(rg, GSN_DROP_OBJ_REF, trans_key);
     sendSignal(rg, GSN_DROP_OBJ_REQ, signal, 
 	       DropObjReq::SignalLength, JBB);
+
+    c_blockState = BS_CREATE_TAB;
+
     return;
   } while(0);
   
@@ -13892,6 +13954,7 @@
     //@todo check api failed
     sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILEGROUP_CONF, signal, 
 	       CreateFilegroupConf::SignalLength, JBB);
+
     break;
   }
   case GSN_CREATE_FILE_REQ:{
@@ -13935,6 +13998,7 @@
   }
   
   c_Trans.release(trans_ptr);
+  ndbrequire(c_blockState == BS_CREATE_TAB);
   c_blockState = BS_IDLE;
   return;
 }
@@ -14047,6 +14111,7 @@
   }
   
   c_Trans.release(trans_ptr);
+  ndbrequire(c_blockState == BS_CREATE_TAB);
   c_blockState = BS_IDLE;
   return;
 }

--- 1.123/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2006-04-18 15:03:32 +02:00
+++ 1.124/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2006-04-21 14:13:16 +02:00
@@ -4397,7 +4397,7 @@
   ptr[0].p = (Uint32*)m_buffer.get_data();
   ptr[0].sz = m_buffer.length() / 4;
 
-  int err[] = { CreateFileRef::Busy, 0};
+  int err[] = { CreateFileRef::Busy, CreateFileRef::NotMaster, 0};
   /*
     Send signal without time-out since creating files can take a very long
     time if the file is very big.
@@ -4441,7 +4441,7 @@
   req->file_id = file.m_id;
   req->file_version = file.m_version;
 
-  int err[] = { DropFileRef::Busy, 0};
+  int err[] = { DropFileRef::Busy, DropFileRef::NotMaster, 0};
   DBUG_RETURN(dictSignal(&tSignal, 0, 0,
 	                 0, // master
 		         WAIT_CREATE_INDX_REQ,
Thread
bk commit into 5.1 tree (jonas:1.2377) BUG#18575jonas21 Apr