From 2c7b683e4bd7775454889ff2c4d7bea215678154 Mon Sep 17 00:00:00 2001 From: xue_meng_en <1836611252@qq.com> Date: Sat, 9 Mar 2024 18:34:23 +0800 Subject: [PATCH] =?UTF-8?q?cm=E6=9A=82=E5=81=9C=E7=8A=B6=E6=80=81=E4=B8=8B?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/impl/upgrade/UpgradeImpl.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/script/impl/upgrade/UpgradeImpl.py b/script/impl/upgrade/UpgradeImpl.py index 6923cd5..3e10870 100644 --- a/script/impl/upgrade/UpgradeImpl.py +++ b/script/impl/upgrade/UpgradeImpl.py @@ -6591,6 +6591,14 @@ END;""" self.context.logger.debug("Successfully cleaned backup files.", "constant") + def checkCMPausing(self): + cmd = "source %s; gs_om -t status" % self.context.userProfile + status, output = subprocess.getstatusoutput(cmd) + if status == 0 and "pausing" in output: + self.context.logger.debug("The cluster has been paused, upgrade is forbidden.") + return True + return False + ########################################################################### # Rollback upgrade functions ########################################################################### @@ -6620,6 +6628,10 @@ END;""" output += "\n Cluster status does not match condition." if self.checkConnection() != 0: output += "\n Database could not be connected." + old_cluster_config_file = os.path.realpath(os.path.join( + self.context.oldClusterAppPath, "bin", "cluster_static_config")) + if self.get_cms_num(old_cluster_config_file) != 0 and self.checkCMPausing(): + output += "\n Cluster is pausing." elif checkPosition == const.OPTION_POSTCHECK: if len(self.context.nodeNames) != 0: checknodes = self.context.nodeNames