MySQL Cluster Manager (MCM) API Hangs When Connection to Management Node is Lost (Doc ID 1921390.1)

Last updated on AUGUST 16, 2016

Applies to:

MySQL Cluster - Version 7.1 and later
Information in this document applies to any platform.

Symptoms

Have a thread for each Management node (MGM) of the cluster (two Management nodes), in this thread:

ndb_mgm_set_timeout(h, 5000)
ndb_mgm_connect(h, 1, 0, 0) 


If connected, then subscribe MGM events:

int filter[] = {15, NDB_MGM_EVENT_CATEGORY_SHUTDOWN,
15, NDB_MGM_EVENT_CATEGORY_CONNECTION,
15, NDB_MGM_EVENT_CATEGORY_NODE_RESTART,
15, NDB_MGM_EVENT_CATEGORY_STARTUP,
15, NDB_MGM_EVENT_CATEGORY_INFO,
15, NDB_MGM_EVENT_CATEGORY_ERROR,
0};

  

In a while loop listening to MGM events, in case of "Connection, shutdown,nodrestart, startup event" fetch the Cluster state:

int rc = ndb_logevent_get_next(le, &event, timeout);
if (rc > 0)
{
    ...
    Connection, shutdown,nodrestart, startup event=>ndb_mgm_get_status(h);
    else if (rc < 0) //error
    {
        MGMEventErr(le);
        monitoring = false;
    }
}

  
In case of error returned by ndb_logevent_get_next, trying to reconnect to mgm nodes, and start all over again.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms