MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbRestarter Class Reference
Inheritance diagram for NdbRestarter:
Collaboration diagram for NdbRestarter:

Public Types

enum  RestartFlags { NRRF_INITIAL = 0x1, NRRF_NOSTART = 0x2, NRRF_ABORT = 0x4, NRRF_FORCE = 0x8 }
enum  NodeSelector { NS_RANDOM = 0, NS_MASTER = 1, NS_NON_MASTER = 2 }

Public Member Functions

 NdbRestarter (const char *_addr=0)
int getDbNodeId (int _i)
int restartOneDbNode (int _nodeId, bool initial=false, bool nostart=false, bool abort=false, bool force=false)
int restartOneDbNode2 (int _nodeId, Uint32 flags)
int restartAll (bool initial=false, bool nostart=false, bool abort=false, bool force=false)
int restartAll2 (Uint32 flags)
int restartNodes (int *nodes, int num_nodes, Uint32 flags)
int startAll ()
int startNodes (const int *_nodes, int _num_nodes)
int waitConnected (unsigned int _timeout=120)
int waitClusterStarted (unsigned int _timeout=120)
int waitClusterSingleUser (unsigned int _timeout=120)
int waitClusterStartPhase (int _startphase, unsigned int _timeout=120)
int waitClusterNoStart (unsigned int _timeout=120)
int waitNodesStarted (const int *_nodes, int _num_nodes, unsigned int _timeout=120)
int waitNodesStartPhase (const int *_nodes, int _num_nodes, int _startphase, unsigned int _timeout=120)
int waitNodesNoStart (const int *_nodes, int _num_nodes, unsigned int _timeout=120)
int checkClusterAlive (const int *deadnodes, int num_nodes)
int getNumDbNodes ()
int insertErrorInNode (int _nodeId, int error)
int insertErrorInAllNodes (int error)
int enterSingleUserMode (int _nodeId)
int exitSingleUserMode ()
int dumpStateOneNode (int _nodeId, const int *_args, int _num_args)
int dumpStateAllNodes (const int *_args, int _num_args)
int getMasterNodeId ()
int getNextMasterNodeId (int nodeId)
int getNodeGroup (int nodeId)
int getRandomNodeSameNodeGroup (int nodeId, int randomNumber)
int getRandomNodeOtherNodeGroup (int nodeId, int randomNumber)
int getRandomNotMasterNodeId (int randomNumber)
int getMasterNodeVersion (int &version)
int getNodeTypeVersionRange (ndb_mgm_node_type type, int &minVer, int &maxVer)
int getNodeStatus (int nodeId)
int getNode (NodeSelector)
void setReconnect (bool)
int rollingRestart (Uint32 flags=0)

Public Attributes

NdbMgmHandle handle
Vector< ndb_mgm_node_statendbNodes

Protected Member Functions

int waitClusterState (ndb_mgm_node_status _status, unsigned int _timeout, int _startphase=-1)
int waitNodesState (const int *_nodes, int _num_nodes, ndb_mgm_node_status _status, unsigned int _timeout, int _startphase=-1)
bool isConnected ()
int connect ()
void disconnect ()
int getStatus ()
ndb_mgm_configurationgetConfig ()

Protected Attributes

Vector< ndb_mgm_node_statemgmNodes
Vector< ndb_mgm_node_stateapiNodes
bool connected
BaseString addr
ndb_mgm_configurationm_config
bool m_reconnect

Detailed Description

Definition at line 25 of file NdbRestarter.hpp.

Member Function Documentation

int NdbRestarter::restartNodes ( int *  nodes,
int  num_nodes,
Uint32  flags 
)

ndb_mgm_restart4 returned error, one reason could be that the node have not stopped fast enough! Check status of the node to see if it's on the way down. If that's the case ignore the error

Definition at line 86 of file NdbRestarter.cpp.

Here is the call graph for this function:

int NdbRestarter::waitNodesState ( const int *  _nodes,
int  _num_nodes,
ndb_mgm_node_status  _status,
unsigned int  _timeout,
int  _startphase = -1 
)
protected

Timeout has expired waiting for the nodes to enter the state we want

Make special check if we are waiting for cluster to become started

First check if any node is not starting then it's no idea to wait anymore

Definition at line 360 of file NdbRestarter.cpp.

Here is the call graph for this function:


The documentation for this class was generated from the following files: