Bug #52652 ndb_mgm always report "last_completed phase 0" until node is started
Submitted: 7 Apr 2010 10:56 Modified: 24 May 2010 20:48
Reporter: Johan Andersson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.3 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: 6.3.33, 7.0.14, NDB_MGM

[7 Apr 2010 10:56] Johan Andersson
Description:
ndb_mgm> all status
Node 3: started (mysql-5.1.44 ndb-7.0.14)
Node 4: starting (Last completed phase 0) (mysql-5.1.44 ndb-7.0.14)

But the cluster log shows:

2010-04-07 12:53:37 [MgmtSrvr] INFO     -- Node 4: Start phase 1 completed 
2010-04-07 12:53:37 [MgmtSrvr] INFO     -- Node 4: Node 3: API mysql-5.1.44 ndb-7.0.14
2010-04-07 12:53:37 [MgmtSrvr] INFO     -- Node 4: Start phase 2 completed (node restart)

How to repeat:
start a data node

ndb_mgm -e "all status"

when it is starting

Suggested fix:
..
[8 Apr 2010 6:26] Sveta Smirnova
Thank you for the report.

Verified as described.
[12 Apr 2010 13:18] Jørgen Austvik
workaround: look in the logs
[19 May 2010 14:38] Magnus Blåudd
void
ClusterMgr::execAPI_REGCONF(const Uint32 * theData){
  const ApiRegConf * const apiRegConf = (ApiRegConf *)&theData[0];

<snip>

    node.m_state = apiRegConf->nodeState;
                ^^^ assignment does not work

Adding some printouts:
  ndbout_c("execAPI_REGCONF: [%d] startlevel: %d, spartphase: %d",
           nodeId, apiRegConf->nodeState.startLevel,
           apiRegConf->nodeState.starting.startPhase);
  ndbout_c("node.m_state: [%d] startlevel: %d, spartphase: %d",
           nodeId, node.m_state.startLevel,
           node.m_state.starting.startPhase);

shows:
execAPI_REGCONF: [1] startlevel: 2, spartphase: 4
node.m_state: [1] startlevel: 2, spartphase: 0
                                            ^^^^
[19 May 2010 15:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/108656
[19 May 2010 19:17] Jonas Oreland
patch looks ok,
only question is why it "entered",
was that my "gcc-madness" work ?
[24 May 2010 11:34] Magnus Blåudd
Pushed to 6.3.34, 7.0.15 and 7.1.4
[24 May 2010 20:48] Jon Stephens
Documented in the NDB-6.3.34, 7.0.15, and 7.1.4 changelogs, as follows:

      ndb_mgm -e "all status" erroneously reported that data nodes 
      remained in start phase 0 until they had actually started.       

Closed.