On Tue, Feb 08, 2011 at 06:24:05PM +0100, Stephen Shirley wrote:
> 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: Stephen Shirley <diam...@google.com>
> ---
>  tools/cluster-merge |   30 +++++++++++++++---------------
>  1 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/tools/cluster-merge b/tools/cluster-merge
> index 46311b7..75529a1 100755
> --- a/tools/cluster-merge
> +++ b/tools/cluster-merge
> @@ -403,25 +403,25 @@ class Merger(object):
>        logging.info("Merging config")
>        self._FetchRemoteConfig()
>  
> -      def _OfflineClusterMerge(_):
> -        """Closure run when master daemons stopped
> +      logging.info("Stopping master daemon")
> +      self._KillMasterDaemon()
>  
> -        """
> -        rbsteps.append("Restore %s from another master candidate" %
> -                       constants.CLUSTER_CONF_FILE)
> -        self._MergeConfig()
> -        self._StartMasterDaemon(no_vote=True)
> +      rbsteps.append("Restore %s from another master candidate" %
> +                     constants.CLUSTER_CONF_FILE)
> +      self._MergeConfig()

Any errors in _MergeConfig will leave the cluster in a "broken" state,
as nothing will restart the master daemon. You should add some error
checking here.

Regarding our offline conversation: yes, RunWhileMasterStopped doesn't
make sense here as you need to start the master daemon in a special
mode.

iustin

Reply via email to