fix grey upgrade version number

This commit is contained in:
shirley_zhengx
2021-09-27 16:27:13 +08:00
parent df79350c04
commit 5fe41f8aaf
4 changed files with 25 additions and 8 deletions

View File

@ -216,11 +216,18 @@ class OmImplOLAP(OmImpl):
time_out = DefaultValue.TIMEOUT_CLUSTER_START
else:
time_out = self.time_out
cmd = "source %s; %s -U %s -R %s -t %s --security-mode=%s" % (
self.context.g_opts.mpprcFile,
OMCommand.getLocalScript("Local_StartInstance"),
self.context.user, self.context.clusterInfo.appPath, time_out,
self.context.g_opts.security_mode)
if self.context.g_opts.cluster_number:
cmd = "source %s; %s -U %s -R %s -t %s --security-mode=%s --cluster_number=%s" % (
self.context.g_opts.mpprcFile,
OMCommand.getLocalScript("Local_StartInstance"),
self.context.user, self.context.clusterInfo.appPath, time_out,
self.context.g_opts.security_mode, self.context.g_opts.cluster_number)
else:
cmd = "source %s; %s -U %s -R %s -t %s --security-mode=%s" % (
self.context.g_opts.mpprcFile,
OMCommand.getLocalScript("Local_StartInstance"),
self.context.user, self.context.clusterInfo.appPath, time_out,
self.context.g_opts.security_mode)
if self.dataDir != "":
cmd += " -D %s" % self.dataDir
failedOutput = ''

View File

@ -1286,7 +1286,13 @@ class UpgradeImpl:
start cluster in grey upgrade
:return:
"""
cmd = "gs_om -t start"
versionFile = os.path.join(
self.context.oldClusterAppPath, "bin/upgrade_version")
if os.path.exists(versionFile):
_, number, _ = VersionInfo.get_version_info(versionFile)
cmd = "gs_om -t start --cluster-number='%s'" % (number)
else:
cmd = "gs_om -t start"
(status, output) = subprocess.getstatusoutput(cmd)
if status != 0:
raise Exception(ErrorCode.GAUSS_514["GAUSS_51400"] %