List:Commits« Previous MessageNext Message »
From:jonas Date:April 29 2008 5:39pm
Subject:bk commit into 5.1 tree (jonas:1.2601)
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@stripped, 2008-04-29 19:39:51+02:00, jonas@stripped +2 -0
  ndb - wl3600
    keep operation state consistent
    (needed for table-reorg, but committed against 64)

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2008-04-29 19:39:47+02:00, jonas@stripped +47 -4
    update operation state on participant

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp@stripped, 2008-04-29 19:39:47+02:00, jonas@stripped +1 -0
    update operation state on participant

diff -Nrup a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2008-04-28 12:45:51 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2008-04-29 19:39:47 +02:00
@@ -19700,7 +19700,6 @@ Dbdict::trans_prepare_recv_reply(Signal*
     return;
   }
 
-  op_ptr.p->m_state = SchemaOp::OS_PREPARED;
   {
     LocalDLFifoList<SchemaOp> list(c_schemaOpPool, trans_ptr.p->m_op_list);
     if (list.next(op_ptr))
@@ -20154,7 +20153,6 @@ Dbdict::trans_commit_recv_reply(Signal* 
 
   SchemaOpPtr op_ptr;
   c_schemaOpPool.getPtr(op_ptr, trans_ptr.p->m_curr_op_ptr_i);
-  op_ptr.p->m_state = SchemaOp::OS_COMMITTED;
 
   bool next = false;
   {
@@ -20276,7 +20274,6 @@ Dbdict::trans_complete_recv_reply(Signal
 
   SchemaOpPtr op_ptr;
   c_schemaOpPool.getPtr(op_ptr, trans_ptr.p->m_curr_op_ptr_i);
-  op_ptr.p->m_state = SchemaOp::OS_COMPLETED;
 
   bool next = false;
   {
@@ -20411,11 +20408,13 @@ Dbdict::execSCHEMA_TRANS_IMPL_REQ(Signal
       ndbrequire(false); // handled above
     case SchemaTransImplReq::RT_PREPARE:
       jam();
+      op_ptr.p->m_state = SchemaOp::OS_PREPARING;      
       (this->*(info.m_prepare))(signal, op_ptr);
       return;
     case SchemaTransImplReq::RT_ABORT_PARSE:
       jam();
       ndbrequire(op_ptr.p->nextList == RNIL);
+      op_ptr.p->m_state = SchemaOp::OS_ABORTING_PARSE;
       (this->*(info.m_abortParse))(signal, op_ptr);
       if (!trans_ptr.p->m_isMaster)
       {
@@ -20429,14 +20428,17 @@ Dbdict::execSCHEMA_TRANS_IMPL_REQ(Signal
       return;
     case SchemaTransImplReq::RT_ABORT_PREPARE:
       jam();
+      op_ptr.p->m_state = SchemaOp::OS_ABORTING_PREPARE;
       (this->*(info.m_abortPrepare))(signal, op_ptr);
       return;
     case SchemaTransImplReq::RT_COMMIT:
       jam();
+      op_ptr.p->m_state = SchemaOp::OS_COMMITTING;
       (this->*(info.m_commit))(signal, op_ptr);
       return;
     case SchemaTransImplReq::RT_COMPLETE:
       jam();
+      op_ptr.p->m_state = SchemaOp::OS_COMPLETING;
       (this->*(info.m_complete))(signal, op_ptr);
       return;
     }
@@ -20535,6 +20537,7 @@ Dbdict::slave_run_parse(Signal *signal,
       memcpy(dst, src, len << 2);
 
       addSchemaOp(trans_ptr, op_ptr);
+      op_ptr.p->m_state = SchemaOp::OS_PARSING;
       (this->*(info.m_parse))(signal, false, op_ptr, handle, error);
     } else {
       jam();
@@ -20575,10 +20578,47 @@ Dbdict::slave_run_end(Signal* signal,
 }
 
 void
+Dbdict::update_op_state(SchemaOpPtr op_ptr)
+{
+  switch(op_ptr.p->m_state){
+  case SchemaOp::OS_PARSE_MASTER:
+    break;
+  case SchemaOp::OS_PARSING:
+    op_ptr.p->m_state = SchemaOp::OS_PARSED;
+    break;
+  case SchemaOp::OS_PARSED:
+    ndbrequire(false);
+  case SchemaOp::OS_PREPARING:
+    op_ptr.p->m_state = SchemaOp::OS_PREPARED;
+    break;
+  case SchemaOp::OS_PREPARED:
+    ndbrequire(false);
+  case SchemaOp::OS_ABORTING_PREPARE:
+    op_ptr.p->m_state = SchemaOp::OS_ABORTED_PREPARE;
+    break;
+  case SchemaOp::OS_ABORTED_PREPARE:
+    ndbrequire(false);
+  case SchemaOp::OS_ABORTING_PARSE:
+    break;
+    //case SchemaOp::OS_ABORTED_PARSE:  // Not used, op released
+  case SchemaOp::OS_COMMITTING:
+    op_ptr.p->m_state = SchemaOp::OS_COMMITTED;
+    break;
+  case SchemaOp::OS_COMMITTED:
+    ndbrequire(false);
+  case SchemaOp::OS_COMPLETING:
+    op_ptr.p->m_state = SchemaOp::OS_COMPLETED;
+    break;
+  case SchemaOp::OS_COMPLETED:
+    ndbrequire(false);    
+  }
+}
+
+void
 Dbdict::sendTransConf(Signal* signal, SchemaOpPtr op_ptr)
 {
   SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
-
+  update_op_state(op_ptr);
   sendTransConf(signal, trans_ptr);
 }
 
@@ -20621,6 +20661,9 @@ Dbdict::sendTransRef(Signal* signal, Sch
   // must have error and already propagated to trans
   ndbrequire(hasError(op_ptr.p->m_error));
   ndbrequire(hasError(trans_ptr.p->m_error));
+
+  update_op_state(op_ptr);
+
   sendTransRef(signal, trans_ptr);
 }
 
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2008-04-28 12:45:51 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2008-04-29 19:39:47 +02:00
@@ -1751,6 +1751,7 @@ private:
                          Uint32 op_key, const OpInfo& info,
                          Uint32 requestInfo);
   void runTransSlave(Signal*, SchemaTransPtr);
+  void update_op_state(SchemaOpPtr);
   void sendTransConf(Signal*, SchemaOpPtr);
   void sendTransConf(Signal*, SchemaTransPtr);
   void sendTransRef(Signal*, SchemaOpPtr);
Thread
bk commit into 5.1 tree (jonas:1.2601)jonas29 Apr