MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:tomas Date:October 13 2005 2:38pm
Subject:bk commit into 5.0 tree (tomas:1.2034) BUG#13461
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tomas. When tomas 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.2034 05/10/13 16:38:38 tomas@stripped +5 -0
  Bug #13461  	Slave Cluster crashed on restart of two data nodes in seperate groups
  - ensure in ndb_mgmd that the stop command is not issued if a node is restarting
  - added some new error messages
  - in ndbcntr on master check so that node does not shutdown id shutdoen in progress

  ndb/src/mgmsrv/MgmtSrvr.hpp
    1.39 05/10/13 16:38:30 tomas@stripped +5 -3
    Bug #13461  	Slave Cluster crashed on restart of two data nodes in seperate groups
    - ensure in ndb_mgmd that the stop command is not issued if a node is restarting
    - added some new error messages
    - in ndbcntr on master check so that node does not shutdown id shutdoen in progress

  ndb/src/mgmsrv/MgmtSrvr.cpp
    1.91 05/10/13 16:38:30 tomas@stripped +24 -14
    Bug #13461  	Slave Cluster crashed on restart of two data nodes in seperate groups
    - ensure in ndb_mgmd that the stop command is not issued if a node is restarting
    - added some new error messages
    - in ndbcntr on master check so that node does not shutdown id shutdoen in progress

  ndb/src/kernel/error/ndbd_exit_codes.c
    1.8 05/10/13 16:38:30 tomas@stripped +3 -0
    Bug #13461  	Slave Cluster crashed on restart of two data nodes in seperate groups
    - ensure in ndb_mgmd that the stop command is not issued if a node is restarting
    - added some new error messages
    - in ndbcntr on master check so that node does not shutdown id shutdoen in progress

  ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
    1.24 05/10/13 16:38:30 tomas@stripped +8 -2
    Bug #13461  	Slave Cluster crashed on restart of two data nodes in seperate groups
    - ensure in ndb_mgmd that the stop command is not issued if a node is restarting
    - added some new error messages
    - in ndbcntr on master check so that node does not shutdown id shutdoen in progress

  ndb/include/mgmapi/ndbd_exit_codes.h
    1.8 05/10/13 16:38:30 tomas@stripped +1 -0
    Bug #13461  	Slave Cluster crashed on restart of two data nodes in seperate groups
    - ensure in ndb_mgmd that the stop command is not issued if a node is restarting
    - added some new error messages
    - in ndbcntr on master check so that node does not shutdown id shutdoen in progress

# 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:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.0

--- 1.23/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2005-10-05 16:35:21 +02:00
+++ 1.24/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2005-10-13 16:38:30 +02:00
@@ -525,6 +525,9 @@
     cmasterNodeId = ref->masterNodeId;
     sendCntrStartReq(signal);
     return;
+  case CntrStartRef::StopInProgress:
+    jam();
+    progError(__LINE__, NDBD_EXIT_RESTART_DURING_SHUTDOWN);
   }
   ndbrequire(false);
 }
@@ -2022,7 +2025,9 @@
     return;
   }
 
-  if(c_stopRec.stopReq.senderRef != 0){
+  if(c_stopRec.stopReq.senderRef != 0 ||
+     (cmasterNodeId == getOwnNodeId() && !c_start.m_starting.isclear()))
+  {
     /**
      * Requested a system shutdown
      */
@@ -2036,7 +2041,8 @@
     /**
      * Requested a node shutdown
      */
-    if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo))
+    if(c_stopRec.stopReq.senderRef &&
+       StopReq::getSystemStop(c_stopRec.stopReq.requestInfo))
       ref->errorCode = StopRef::SystemShutdownInProgress;
     else
       ref->errorCode = StopRef::NodeShutdownInProgress;

--- 1.7/ndb/include/mgmapi/ndbd_exit_codes.h	2005-10-11 15:47:57 +02:00
+++ 1.8/ndb/include/mgmapi/ndbd_exit_codes.h	2005-10-13 16:38:30 +02:00
@@ -104,6 +104,7 @@
 
 /* NDBCNTR 6100-> */
 #define NDBD_EXIT_RESTART_TIMEOUT             6100
+#define NDBD_EXIT_RESTART_DURING_SHUTDOWN     6101
 
 /* TC  6200-> */
 /* DIH 6300-> */

--- 1.7/ndb/src/kernel/error/ndbd_exit_codes.c	2005-10-11 15:47:57 +02:00
+++ 1.8/ndb/src/kernel/error/ndbd_exit_codes.c	2005-10-13 16:38:30 +02:00
@@ -101,6 +101,9 @@
    {NDBD_EXIT_RESTART_TIMEOUT, XCE,
     "Total restart time too long, consider increasing StartFailureTimeout "
     "or investigate error(s) on other node(s)"},
+   {NDBD_EXIT_RESTART_DURING_SHUTDOWN, XRE,
+    "Node started while node shutdown in progress. "
+    "Please wait until shutdown complete before starting node"},
 
    /* DIH */
    {NDBD_EXIT_MAX_CRASHED_REPLICAS, XFL,

--- 1.90/ndb/src/mgmsrv/MgmtSrvr.cpp	2005-10-03 20:04:27 +02:00
+++ 1.91/ndb/src/mgmsrv/MgmtSrvr.cpp	2005-10-13 16:38:30 +02:00
@@ -277,15 +277,13 @@
   {MgmtSrvr::NOT_POSSIBLE_TO_SEND_CONFIG_UPDATE_TO_PROCESS_TYPE, 
    "It is not possible to send an update of a configuration variable "
    "to this kind of process."},
-  {5026, "Node shutdown in progress" },
-  {5027, "System shutdown in progress" },
-  {5028, "Node shutdown would cause system crash" },
-  {5029, "Only one shutdown at a time is possible via mgm server" },
-  {5060, "Operation not allowed in single user mode." }, 
-  {5061, "DB is not in single user mode." },
-  {5062, "The specified node is not an API node." },
-  {5063, 
-   "Cannot enter single user mode. DB nodes in inconsistent startlevel."},
+  {MgmtSrvr::NODE_SHUTDOWN_IN_PROGESS, "Node shutdown in progress" },
+  {MgmtSrvr::SYSTEM_SHUTDOWN_IN_PROGRESS, "System shutdown in progress" },
+  {MgmtSrvr::NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH,
+   "Node shutdown would cause system crash" },
+  {MgmtSrvr::NODE_NOT_API_NODE, "The specified node is not an API node." },
+  {MgmtSrvr::OPERATION_NOT_ALLOWED_START_STOP, 
+   "Operation not allowed while nodes are starting or stopping."},
   {MgmtSrvr::NO_CONTACT_WITH_DB_NODES, "No contact with database nodes" }
 };
 
@@ -293,13 +291,13 @@
 {
   switch(errCode){
   case StopRef::NodeShutdownInProgress:
-    return 5026;
+    return NODE_SHUTDOWN_IN_PROGESS;
     break;
   case StopRef::SystemShutdownInProgress:
-    return 5027;
+    return SYSTEM_SHUTDOWN_IN_PROGRESS;
     break;
   case StopRef::NodeShutdownWouldCauseSystemCrash:
-    return 5028;
+    return NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH;
     break;
   }
   return 4999;
@@ -989,6 +987,18 @@
 
 int MgmtSrvr::stopNode(int nodeId, bool abort)
 {
+  if (!abort)
+  {
+    NodeId nodeId = 0;
+    ClusterMgr::Node node;
+    while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB))
+    {
+      node = theFacade->theClusterMgr->getNodeInfo(nodeId);
+      if((node.m_state.startLevel != NodeState::SL_STARTED) && 
+	 (node.m_state.startLevel != NodeState::SL_NOTHING))
+	return OPERATION_NOT_ALLOWED_START_STOP;
+    }
+  }
   NodeBitmask nodes;
   return sendSTOP_REQ(nodeId,
 		      nodes,
@@ -1027,7 +1037,7 @@
 int MgmtSrvr::enterSingleUser(int * stopCount, Uint32 singleUserNodeId)
 {
   if (getNodeType(singleUserNodeId) != NDB_MGM_NODE_TYPE_API)
-    return 5062;
+    return NODE_NOT_API_NODE;
   NodeId nodeId = 0;
   ClusterMgr::Node node;
   while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB))
@@ -1035,7 +1045,7 @@
     node = theFacade->theClusterMgr->getNodeInfo(nodeId);
     if((node.m_state.startLevel != NodeState::SL_STARTED) && 
        (node.m_state.startLevel != NodeState::SL_NOTHING))
-      return 5063;
+      return OPERATION_NOT_ALLOWED_START_STOP;
   }
   NodeBitmask nodes;
   int ret = sendSTOP_REQ(0,

--- 1.38/ndb/src/mgmsrv/MgmtSrvr.hpp	2005-10-03 20:04:27 +02:00
+++ 1.39/ndb/src/mgmsrv/MgmtSrvr.hpp	2005-10-13 16:38:30 +02:00
@@ -174,10 +174,12 @@
   STATIC_CONST( NODE_SHUTDOWN_IN_PROGESS = 5026 );
   STATIC_CONST( SYSTEM_SHUTDOWN_IN_PROGRESS = 5027 );
   STATIC_CONST( NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH = 5028 );
-  STATIC_CONST( NO_CONTACT_WITH_CLUSTER = 6666 );
-  STATIC_CONST( OPERATION_IN_PROGRESS = 6667 );
-  
+
   STATIC_CONST( NO_CONTACT_WITH_DB_NODES = 5030 );
+
+  STATIC_CONST( NODE_NOT_API_NODE = 5062 );
+  STATIC_CONST( OPERATION_NOT_ALLOWED_START_STOP = 5063 );
+
   /**
    *   This enum specifies the different signal loggig modes possible to set 
    *   with the setSignalLoggingMode method.
Thread
bk commit into 5.0 tree (tomas:1.2034) BUG#13461tomas13 Oct