MySQL NDB Cluster API Developer Guide  /  The MGM API  /  MGM API Data Structures

3.4 MGM API Data Structures

This section provides information about the data structures defined by the MGM API.

The ndb_logevent Structure

Description

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* handle: An NdbLogEventHandle, 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 time: The time at which the log event was registered with the management server.

  • category: The log event category (ndb_mgm_event_category).

  • severity: The log event severity (ndb_mgm_event_severity).

  • unsigned level: The log event level. This is a value in the range of 0 to 15, inclusive.

  • unsigned source_nodeid: The node ID of the node that reported this event.

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:
Press CTRL+C to copy
unsigned node
NDB_LE_Disconnected Disconnected:
Press CTRL+C to copy
unsigned node
NDB_LE_CommunicationClosed CommunicationClosed:
Press CTRL+C to copy
unsigned node
NDB_LE_CommunicationOpened CommunicationOpened:
Press CTRL+C to copy
unsigned node
NDB_LE_ConnectedApiVersion ConnectedApiVersion:
Press CTRL+C to copy
unsigned node unsigned version
NDB_LE_GlobalCheckpointStarted GlobalCheckpointStarted:
Press CTRL+C to copy
unsigned gci
NDB_LE_GlobalCheckpointCompleted GlobalCheckpointCompleted:
Press CTRL+C to copy
unsigned gci
NDB_LE_LocalCheckpointStarted LocalCheckpointStarted:
Press CTRL+C to copy
unsigned lci unsigned keep_gci unsigned restore_gci
NDB_LE_LocalCheckpointCompleted LocalCheckpointCompleted:
Press CTRL+C to copy
unsigned lci
NDB_LE_LCPStoppedInCalcKeepGci LCPStoppedInCalcKeepGci:
Press CTRL+C to copy
unsigned data
NDB_LE_LCPFragmentCompleted LCPFragmentCompleted:
Press CTRL+C to copy
unsigned node unsigned table_id unsigned fragment_id
NDB_LE_UndoLogBlocked UndoLogBlocked:
Press CTRL+C to copy
unsigned acc_count unsigned tup_count
NDB_LE_NDBStartStarted NDBStartStarted:
Press CTRL+C to copy
unsigned version
NDB_LE_NDBStartCompleted NDBStartCompleted:
Press CTRL+C to copy
unsigned version
NDB_LE_STTORRYRecieved STTORRYRecieved:
Press CTRL+C to copy
[NONE]
NDB_LE_StartPhaseCompleted StartPhaseCompleted:
Press CTRL+C to copy
unsigned phase unsigned starttype
NDB_LE_CM_REGCONF CM_REGCONF:
Press CTRL+C to copy
unsigned own_id unsigned president_id unsigned dynamic_id
NDB_LE_CM_REGREF CM_REGREF:
Press CTRL+C to copy
unsigned own_id unsigned other_id unsigned cause
NDB_LE_FIND_NEIGHBOURS FIND_NEIGHBOURS:
Press CTRL+C to copy
unsigned own_id unsigned left_id unsigned right_id unsigned dynamic_id
NDB_LE_NDBStopStarted NDBStopStarted:
Press CTRL+C to copy
unsigned stoptype
NDB_LE_NDBStopCompleted NDBStopCompleted:
Press CTRL+C to copy
unsigned action unsigned signum
NDB_LE_NDBStopForced NDBStopForced:
Press CTRL+C to copy
unsigned action unsigned signum unsigned error unsigned sphase unsigned extra
NDB_LE_NDBStopAborted NDBStopAborted:
Press CTRL+C to copy
[NONE]
NDB_LE_StartREDOLog StartREDOLog:
Press CTRL+C to copy
unsigned node unsigned keep_gci unsigned completed_gci unsigned restorable_gci
NDB_LE_StartLog StartLog:
Press CTRL+C to copy
unsigned log_part unsigned start_mb unsigned stop_mb unsigned gci
NDB_LE_UNDORecordsExecuted UNDORecordsExecuted:
Press CTRL+C to copy
unsigned block unsigned data1 unsigned data2 unsigned data3 unsigned data4 unsigned data5 unsigned data6 unsigned data7 unsigned data8 unsigned data9 unsigned data10
NDB_LE_NR_CopyDict NR_CopyDict:
Press CTRL+C to copy
[NONE]
NDB_LE_NR_CopyDistr NR_CopyDistr:
Press CTRL+C to copy
[NONE]
NDB_LE_NR_CopyFragsStarted NR_CopyFragsStarted:
Press CTRL+C to copy
unsigned dest_node
NDB_LE_NR_CopyFragDone NR_CopyFragDone:
Press CTRL+C to copy
unsigned dest_node unsigned table_id unsigned fragment_id
NDB_LE_NR_CopyFragsCompleted NR_CopyFragsCompleted:
Press CTRL+C to copy
unsigned dest_node
NDB_LE_NodeFailCompleted NodeFailCompleted:
Press CTRL+C to copy
unsigned block unsigned failed_node unsigned completing_node
(For block and completing_node, 0 is interpreted as all.)
NDB_LE_NODE_FAILREP NODE_FAILREP:
Press CTRL+C to copy
unsigned failed_node unsigned failure_state
NDB_LE_ArbitState ArbitState:
Press CTRL+C to copy
unsigned code unsigned arbit_node unsigned ticket_0 unsigned ticket_1
NDB_LE_ArbitResult ArbitResult:
Press CTRL+C to copy
unsigned code unsigned arbit_node unsigned ticket_0 unsigned ticket_1
NDB_LE_GCP_TakeoverStarted GCP_TakeoverStarted:
Press CTRL+C to copy
[NONE]
NDB_LE_GCP_TakeoverCompleted GCP_TakeoverCompleted:
Press CTRL+C to copy
[NONE]
NDB_LE_LCP_TakeoverStarted LCP_TakeoverStarted:
Press CTRL+C to copy
[NONE]
NDB_LE_TransReportCounters TransReportCounters:
Press CTRL+C to copy
unsigned trans_count unsigned commit_count unsigned read_count unsigned simple_read_count unsigned write_count unsigned attrinfo_count unsigned conc_op_count unsigned abort_count unsigned scan_count unsigned range_scan_count
NDB_LE_OperationReportCounters OperationReportCounters:
Press CTRL+C to copy
unsigned ops
NDB_LE_TableCreated TableCreated:
Press CTRL+C to copy
unsigned table_id
NDB_LE_JobStatistic JobStatistic:
Press CTRL+C to copy
unsigned mean_loop_count
NDB_LE_SendBytesStatistic SendBytesStatistic:
Press CTRL+C to copy
unsigned to_node unsigned mean_sent_bytes
NDB_LE_ReceiveBytesStatistic ReceiveBytesStatistic:
Press CTRL+C to copy
unsigned from_node unsigned mean_received_bytes
NDB_LE_MemoryUsage MemoryUsage:
Press CTRL+C to copy
int gth unsigned page_size_kb unsigned pages_used unsigned pages_total unsigned block
NDB_LE_TransporterError TransporterError:
Press CTRL+C to copy
unsigned to_node unsigned code
NDB_LE_TransporterWarning TransporterWarning:
Press CTRL+C to copy
unsigned to_node unsigned code
NDB_LE_MissedHeartbeat MissedHeartbeat:
Press CTRL+C to copy
unsigned node unsigned count
NDB_LE_DeadDueToHeartbeat DeadDueToHeartbeat:
Press CTRL+C to copy
unsigned node
NDB_LE_WarningEvent WarningEvent:
Press CTRL+C to copy
[NOT YET IMPLEMENTED]
NDB_LE_SentHeartbeat SentHeartbeat:
Press CTRL+C to copy
unsigned node
NDB_LE_CreateLogBytes CreateLogBytes:
Press CTRL+C to copy
unsigned node
NDB_LE_InfoEvent InfoEvent:
Press CTRL+C to copy
[NOT YET IMPLEMENTED]
NDB_LE_EventBufferStatus (Prior to NDB 7.5) EventBufferStatus::
Press CTRL+C to copy
unsigned usage unsigned alloc unsigned max unsigned apply_gci_l unsigned apply_gci_h unsigned latest_gci_l unsigned latest_gci_h
NDB_LE_EventBufferStatus2 (NDB 7.5) EventBufferStatus2:
Press CTRL+C to copy
unsigned usage unsigned alloc unsigned max unsigned latest_consumed_epoch_l unsigned latest_consumed_epoch_h unsigned latest_buffered_epoch_l unsigned latest_buffered_epoch_h unsigned ndb_reference unsigned report_reason
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:
Press CTRL+C to copy
unsigned starting_node unsigned backup_id
NDB_LE_BackupFailedToStart BackupFailedToStart:
Press CTRL+C to copy
unsigned starting_node unsigned error
NDB_LE_BackupCompleted BackupCompleted:
Press CTRL+C to copy
unsigned starting_node unsigned backup_id unsigned start_gci unsigned stop_gci unsigned n_records unsigned n_log_records unsigned n_bytes unsigned n_log_bytes
NDB_LE_BackupAborted BackupAborted:
Press CTRL+C to copy
unsigned starting_node unsigned backup_id unsigned error
NDB_LE_SingleUser SingleUser:
Press CTRL+C to copy
unsigned type unsigned node_id
NDB_LE_StartReport StartReport:
Press CTRL+C to copy
unsigned report_type unsigned remaining_time unsigned bitmask_size unsigned bitmask_data[1]
Ndb_logevent_type Value Structure

The ndb_mgm_node_state Structure

Description

Provides information on the status of a Cluster node.

Definition.  This structure contains the following members:

  • int node_id: The cluster node's node ID.

  • enum ndb_mgm_node_type node_type: The node type.

    See The ndb_mgm_node_type Type, for permitted values.

  • enum ndb_mgm_node_status node_status: The node's status.

    See The ndb_mgm_node_status Type, for permitted values.

  • int start_phase: The 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 dynamic_id: The ID for heartbeats and master takeover.

    Valid only for data (ndbd) nodes.

  • int node_group: The node group to which the node belongs.

    Valid only for data (ndbd) nodes.

  • int version: Internal version number.

  • int connect_count: The number of times this node has connected to or disconnected from the management server.

  • char connect_address[]: The IP address of this node as seen by the other nodes in the cluster.

  • int mysql_version: The MySQL version number, expressed as an integer (for example: 80200). Applies only to SQL nodes.

  • int is_single_user: 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.

The ndb_mgm_node_state2 Structure

Description

Provides information on the status of a Cluster node.

Definition.  This structure contains the following members:

  • int node_id: The cluster node's node ID.

  • enum ndb_mgm_node_type node_type: The node type.

    See The ndb_mgm_node_type Type, for permitted values.

  • enum ndb_mgm_node_status node_status: The node's status.

    See The ndb_mgm_node_status Type, for permitted values.

  • int start_phase: The 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 dynamic_id: The ID for heartbeats and master takeover.

    Valid only for data (ndbd) nodes.

  • int node_group: The node group to which the node belongs.

    Valid only for data (ndbd) nodes.

  • int version: Internal version number.

  • int connect_count: The number of times this node has connected to or disconnected from the management server.

  • int mysql_version: The MySQL version number, expressed as an integer (for example: 80200). Applies only to SQL nodes.

  • int is_single_user: The node ID of the API or SQL node having exclusive access when the cluster is in single user mode. Does not otherwise apply.

  • char connect_address[]: The IP address of this node as seen by the other nodes in the cluster.

The ndb_mgm_cluster_state Structure

Description

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 no_of_nodes: The number of elements in the node_states array.

  • struct ndb_mgm_node_state node_states[]: An array containing the states of the nodes.

    Each element of this array is an ndb_mgm_node_state structure.

See ndb_mgm_get_status().

The ndb_mgm_cluster_state2 Structure

Description

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 no_of_nodes: The number of elements in the node_states array.

  • struct ndb_mgm_node_state2 node_states[]: An array containing the states of the nodes.

    Each element of this array is an ndb_mgm_node_state2 structure.

See ndb_mgm_get_status3().

The ndb_mgm_reply Structure

Description

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 return_code: For a successful operation, this value is 0; otherwise, it contains an error code.

    For error codes, see The ndb_mgm_error Type.

  • char message[256]: contains the text of the response or error message.

See ndb_mgm_get_latest_error(), and ndb_mgm_get_latest_error_msg().