-
unknown authored
Improvements that were discussed with Tomas. Maintain protocol backwards/forwards compatibilty for client and server and support the commands from ndb_mgm 'as expected' ndb/include/mgmapi/mgmapi.h: Add ndb_mgm_stop3 mgmapi function. - This supports stopping all DB nodes, or all DB and MGM nodes. - It also returns to mgmapi program if it needs to disconnect to apply changes. Add ndb_mgm_restart3 mgmapi function. - Tells mgmapi program if it needs to disconnect to apply changes Add (internal) ndb_mgm_get_version - designed to be used to find out what protocol version we need to speak to the server. ndb/src/mgmapi/mgmapi.cpp: Add cache of mgmd version to ndb_mgm_handle. Only filled out in functions that need to know the version of the mgmd we're talking to. Initialize these members in create handle. added ndb_mgm_get_version which asks the mgm server what version it is. This call has been supported since the dawn of time, no compatibility issues here. Add implementation of ndb_mgm_stop3 Check what version of the protocol the server speaks, and speak it. Add compatibility for ndb_mgm_stop2 Same for ndb_mgm_restart3. ndb/src/mgmclient/CommandInterpreter.cpp: Simplify stop and restart code. Use the new ndb_mgm_(stop|restart)3 calls to find out if we need to disconnect. ndb/src/mgmsrv/MgmtSrvr.cpp: Add nice call for shutting down MGM servers (like shutdownDB) ndb/src/mgmsrv/MgmtSrvr.hpp: add prototype for shutdownMGM ndb/src/mgmsrv/Services.cpp: Add restart node v2, stop v2, stop all v2 while maintaining protocol backwards compatibility. Unfortunately we can't add result lines due to protocol errors in clients :( Neither can we add extra things to the 'result: Ok' line due to the use of strcmp instead of strncmp. ndb/src/mgmsrv/Services.hpp: Add prototypes for restart, stop and stopall v1 and v2
e1c9dd5f