Bug #49184 ndb_mgm_stop does not wait for the full node failover procedure to finish
Submitted: 29 Nov 2009 7:50
Reporter: Bogdan Kecman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: NDB API Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[29 Nov 2009 7:50] Bogdan Kecman
Description:
ndb_mgm_stop does not wait for the full node failover procedure to finish. Weather ndb_mgm_stop or ndb_mgm_stop2 or ndb_mgm_stop3 is called (they finally call ndb_mgm_stop3) the procedure just send the stop command but does not wait for the failover to finish, so if you stop the node and then try to start it immediately after the function returns the node start will fail with 

Error: 1703 (Node failure handling not completed)

How to repeat:
create ndb api app, call ndb_mgm_stop2() (with abort=1 for e.g.) and immediately after ndb_mgm_stop2() returns call system function to start the node you just stopped -> you will get error 1703

Suggested fix:
do not return from ndb_mgm_stop() until full failover procedure is done - or add flag to ndb_mgm_stop4() and set ndb_mgm_stop3() to call ndb_mgm_stop4() that will tell function to wait for the procedure to be done.