MySQL NDB Cluster API Developer Guide
This section provides information about the data structures defined by the MGM API.
This structure models a Cluster log event, and is used for storing and retrieving log event information.
Definition.
ndb_logevent has 8 members, the first 7 of
which are shown in the following list:
void* :
An handleNdbLogEventHandle, set by
ndb_logevent_get_next().
This handle is used only for purposes of comparison.
type: Tells which type of event
(Ndb_logevent_type) this
is.
unsigned :
The time at which the log event was registered with the
management server.
time
category: The log event category
(ndb_mgm_event_category).
severity: The log event severity
(ndb_mgm_event_severity).
unsigned
: The log event
level. This is a value in the range of 0 to 15, inclusive.
level
unsigned
: The node
ID of the node that reported this event.
source_nodeid
The 8th member of this structure
contains data specific to the log event, and is dependent on its
type. It is defined as the union of a number of data structures,
each corresponding to a log event type. Which structure to use
is determined by the value of type,
and is shown in the following table:
Table 3.7 Type Ndb_logevent_type values and structures used
Ndb_logevent_type Value |
Structure |
|---|---|
NDB_LE_Connected |
Connected:unsigned |
NDB_LE_Disconnected |
Disconnected:unsigned |
NDB_LE_CommunicationClosed |
CommunicationClosed:unsigned |
NDB_LE_CommunicationOpened |
CommunicationOpened:unsigned |
NDB_LE_ConnectedApiVersion |
ConnectedApiVersion:unsigned |
NDB_LE_GlobalCheckpointStarted |
GlobalCheckpointStarted:unsigned |
NDB_LE_GlobalCheckpointCompleted |
GlobalCheckpointCompleted:unsigned |
NDB_LE_LocalCheckpointStarted |
LocalCheckpointStarted:unsigned |
NDB_LE_LocalCheckpointCompleted |
LocalCheckpointCompleted:unsigned |
NDB_LE_LCPStoppedInCalcKeepGci |
LCPStoppedInCalcKeepGci:unsigned |
NDB_LE_LCPFragmentCompleted |
LCPFragmentCompleted:unsigned |
NDB_LE_UndoLogBlocked |
UndoLogBlocked:unsigned |
NDB_LE_NDBStartStarted |
NDBStartStarted:unsigned |
NDB_LE_NDBStartCompleted |
NDBStartCompleted:unsigned |
NDB_LE_STTORRYRecieved |
STTORRYRecieved:[NONE]
|
NDB_LE_StartPhaseCompleted |
StartPhaseCompleted:unsigned |
NDB_LE_CM_REGCONF |
CM_REGCONF:unsigned |
NDB_LE_CM_REGREF |
CM_REGREF:unsigned |
NDB_LE_FIND_NEIGHBOURS |
FIND_NEIGHBOURS:unsigned |
NDB_LE_NDBStopStarted |
NDBStopStarted:unsigned |
NDB_LE_NDBStopCompleted |
NDBStopCompleted:unsigned |
NDB_LE_NDBStopForced |
NDBStopForced:unsigned |
NDB_LE_NDBStopAborted |
NDBStopAborted:[NONE]
|
NDB_LE_StartREDOLog |
StartREDOLog:unsigned |
NDB_LE_StartLog |
StartLog:unsigned |
NDB_LE_UNDORecordsExecuted |
UNDORecordsExecuted:unsigned |
NDB_LE_NR_CopyDict |
NR_CopyDict:[NONE]
|
NDB_LE_NR_CopyDistr |
NR_CopyDistr:[NONE]
|
NDB_LE_NR_CopyFragsStarted |
NR_CopyFragsStarted:unsigned |
NDB_LE_NR_CopyFragDone |
NR_CopyFragDone:unsigned |
NDB_LE_NR_CopyFragsCompleted |
NR_CopyFragsCompleted:unsigned |
NDB_LE_NodeFailCompleted |
NodeFailCompleted:unsigned(For block and
completing_node,
0 is interpreted as
“all”.) |
NDB_LE_NODE_FAILREP |
NODE_FAILREP:unsigned |
NDB_LE_ArbitState |
ArbitState:unsigned |
NDB_LE_ArbitResult |
ArbitResult:unsigned |
NDB_LE_GCP_TakeoverStarted |
GCP_TakeoverStarted:[NONE]
|
NDB_LE_GCP_TakeoverCompleted |
GCP_TakeoverCompleted:[NONE]
|
NDB_LE_LCP_TakeoverStarted |
LCP_TakeoverStarted:[NONE]
|
NDB_LE_TransReportCounters |
TransReportCounters:unsigned |
NDB_LE_OperationReportCounters |
OperationReportCounters:unsigned |
NDB_LE_TableCreated |
TableCreated:unsigned |
NDB_LE_JobStatistic |
JobStatistic:unsigned |
NDB_LE_SendBytesStatistic |
SendBytesStatistic:unsigned |
NDB_LE_ReceiveBytesStatistic |
ReceiveBytesStatistic:unsigned |
NDB_LE_MemoryUsage |
MemoryUsage:int |
NDB_LE_TransporterError |
TransporterError:unsigned |
NDB_LE_TransporterWarning |
TransporterWarning:unsigned |
NDB_LE_MissedHeartbeat |
MissedHeartbeat:unsigned |
NDB_LE_DeadDueToHeartbeat |
DeadDueToHeartbeat:unsigned |
NDB_LE_WarningEvent |
WarningEvent:[NOT YET IMPLEMENTED]
|
NDB_LE_SentHeartbeat |
SentHeartbeat:unsigned |
NDB_LE_CreateLogBytes |
CreateLogBytes:unsigned |
NDB_LE_InfoEvent |
InfoEvent:[NOT YET IMPLEMENTED]
|
NDB_LE_EventBufferStatus (Prior to NDB 7.5) |
EventBufferStatus::unsigned |
NDB_LE_EventBufferStatus2 (NDB 7.5) |
EventBufferStatus2:unsigned report_reason is one of
NO_REPORT,
COMPLETELY_BUFFERING,
PARTIALLY_DISCARDING,
COMPLETELY_DISCARDING,
PARTIALLY_BUFFERING,
BUFFERED_EPOCHS_OVER_THRESHOLD,
ENOUGH_FREE_EVENTBUFFER, or
LOW_FREE_EVENTBUFFER; see
Event Buffer Reporting in the Cluster Log, for
descriptions of these values |
NDB_LE_BackupStarted |
BackupStarted:unsigned |
NDB_LE_BackupFailedToStart |
BackupFailedToStart:unsigned |
NDB_LE_BackupCompleted |
BackupCompleted:unsigned |
NDB_LE_BackupAborted |
BackupAborted:unsigned |
NDB_LE_SingleUser |
SingleUser:unsigned |
NDB_LE_StartReport |
StartReport:unsigned |
Provides information on the status of a Cluster node.
Definition. This structure contains the following members:
int :
The cluster node's node ID.
node_id
enum ndb_mgm_node_type
: The node
type.
node_type
See The ndb_mgm_node_type Type, for permitted values.
enum ndb_mgm_node_status
: The
node's status.
node_status
See The ndb_mgm_node_status Type, for permitted values.
int
: The start
phase.
start_phase
This is valid only if the
node_type is
NDB_MGM_NODE_TYPE_NDB and the
node_status is
NDB_MGM_NODE_STATUS_STARTING.
int
: The ID for
heartbeats and master takeover.
dynamic_id
Valid only for data (ndbd) nodes.
int
: The node
group to which the node belongs.
node_group
Valid only for data (ndbd) nodes.
int :
Internal version number.
version
int
: The
number of times this node has connected to or disconnected
from the management server.
connect_count
char
: The
IP address of this node as seen by the other nodes in the
cluster.
connect_address[]
int
: The
MySQL version number, expressed as an integer (for example:
mysql_version80200). Applies only to
SQL nodes.
int
: The
node ID of the API or SQL node having exclusive access when
the cluster is in single user mode. Does not otherwise
apply. Added in NDB 8.0.
is_single_user
Provides information on the status of a Cluster node.
Definition. This structure contains the following members:
int :
The cluster node's node ID.
node_id
enum ndb_mgm_node_type
: The node
type.
node_type
See The ndb_mgm_node_type Type, for permitted values.
enum ndb_mgm_node_status
: The
node's status.
node_status
See The ndb_mgm_node_status Type, for permitted values.
int
: The start
phase.
start_phase
This is valid only if the
node_type is
NDB_MGM_NODE_TYPE_NDB and the
node_status is
NDB_MGM_NODE_STATUS_STARTING.
int
: The ID for
heartbeats and master takeover.
dynamic_id
Valid only for data (ndbd) nodes.
int
: The node
group to which the node belongs.
node_group
Valid only for data (ndbd) nodes.
int :
Internal version number.
version
int
: The
number of times this node has connected to or disconnected
from the management server.
connect_count
int
: The
MySQL version number, expressed as an integer (for example:
mysql_version80200). Applies only to
SQL nodes.
int
: The
node ID of the API or SQL node having exclusive access when
the cluster is in single user mode. Does not otherwise
apply.
is_single_user
char
: The
IP address of this node as seen by the other nodes in the
cluster.
connect_address[]
Provides information on the status of all Cluster nodes.
This structure is returned by
ndb_mgm_get_status().
Definition. This structure has the following two members:
int
: The number
of elements in the no_of_nodesnode_states
array.
struct ndb_mgm_node_state
: An array
containing the states of the nodes.
node_states[]
Each element of this array is an
ndb_mgm_node_state
structure.
See ndb_mgm_get_status().
Provides information on the status of all Cluster nodes.
This structure is returned by
ndb_mgm_get_status3(),
and was added in NDB 8.0.
Definition. This structure has the following two members:
int
: The number
of elements in the no_of_nodesnode_states
array.
struct ndb_mgm_node_state2
: An array
containing the states of the nodes.
node_states[]
Each element of this array is an
ndb_mgm_node_state2
structure.
Contains response information, consisting of a response code and a corresponding message, from the management server.
Definition. This structure contains two members, as shown here:
int
: For a
successful operation, this value is return_code0;
otherwise, it contains an error code.
For error codes, see The ndb_mgm_error Type.
char
: contains
the text of the response or error message.
message[256]
See ndb_mgm_get_latest_error(), and ndb_mgm_get_latest_error_msg().