Commit 9c03a67a authored by Stephen Shirley's avatar Stephen Shirley Committed by Iustin Pop
Browse files

Fix cluster-merging by not stopping noded



cli.RunWhileClusterStopped() stops noded on all of the nodes in the
original cluster. This prevents /etc/hosts updates on the master, and
config redistribution doesn't reach the other nodes in the original
cluster. As all we want to do is merge while the master is stopped,
simply stop it and start it again after.
Signed-off-by: default avatarStephen Shirley <diamond@google.com>
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 11dcce87
......@@ -403,25 +403,26 @@ class Merger(object):
logging.info("Merging config")
self._FetchRemoteConfig()
def _OfflineClusterMerge(_):
"""Closure run when master daemons stopped
"""
rbsteps.append("Restore %s from another master candidate" %
constants.CLUSTER_CONF_FILE)
self._MergeConfig()
self._StartMasterDaemon(no_vote=True)
# Point of no return, delete rbsteps
del rbsteps[:]
logging.warning("We are at the point of no return. Merge can not easily"
" be undone after this point.")
logging.info("Readd nodes and redistribute config")
self._ReaddMergedNodesAndRedist()
self._KillMasterDaemon()
cli.RunWhileClusterStopped(logging.info, _OfflineClusterMerge)
logging.info("Stopping master daemon")
self._KillMasterDaemon()
rbsteps.append("Restore %s from another master candidate"
" and restart master daemon" %
constants.CLUSTER_CONF_FILE)
self._MergeConfig()
self._StartMasterDaemon(no_vote=True)
# Point of no return, delete rbsteps
del rbsteps[:]
logging.warning("We are at the point of no return. Merge can not easily"
" be undone after this point.")
logging.info("Readd nodes")
self._ReaddMergedNodesAndRedist()
logging.info("Merge done, restart master daemon normally")
self._KillMasterDaemon()
self._StartMasterDaemon()
logging.info("Starting instances again")
self._StartupAllInstances()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment