You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by rl...@apache.org on 2015/12/17 04:42:19 UTC

[2/3] incubator-hawq git commit: HAWQ-254. Add master restart warning before init standby.

HAWQ-254. Add master restart warning before init standby.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/0562d560
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/0562d560
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/0562d560

Branch: refs/heads/master
Commit: 0562d560fc9ffded0decd294ce12a8ca28776e21
Parents: 3fac65f
Author: rlei <rl...@pivotal.io>
Authored: Thu Dec 17 11:13:11 2015 +0800
Committer: rlei <rl...@pivotal.io>
Committed: Thu Dec 17 11:41:28 2015 +0800

----------------------------------------------------------------------
 tools/bin/hawq_ctl | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0562d560/tools/bin/hawq_ctl
----------------------------------------------------------------------
diff --git a/tools/bin/hawq_ctl b/tools/bin/hawq_ctl
index 7ffdb83..e49eff0 100755
--- a/tools/bin/hawq_ctl
+++ b/tools/bin/hawq_ctl
@@ -57,6 +57,7 @@ class HawqInit:
         self.hawq_dict = hawq_dict
         self.locale = opts.hawq_locale
         self.quiet  = opts.quiet_run
+        self.prompt = opts.prompt
         self.hawq_lc_collate= opts.hawq_lc_collate
         self.hawq_lc_ctype = opts.hawq_lc_ctype
         self.hawq_lc_messages = opts.hawq_lc_messages
@@ -344,6 +345,9 @@ class HawqInit:
             logger.info("Try to remove standby master")
             self.hawq_remove_standby()
         elif self.node_type == "standby":
+            if self.prompt:
+                if not userinput.ask_yesno(None, "\nMaster will be restarted, continue", 'N'):
+                    sys.exit(1)
             if self.standby_host_name.lower() in ('', 'none'):
                 logger.info("No standby host found")
                 logger.info("Please check your standby host name")