!595 修复在备机升级&就地升级失败的问题

Merge pull request !595 from chenxiaobin/cpDolphin
This commit is contained in:
opengauss_bot 2023-11-07 06:54:35 +00:00 committed by Gitee
commit dfea6dd606
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -2391,6 +2391,7 @@ class UpgradeImpl:
self.recordNodeStepInplace(const.ACTION_INPLACE_UPGRADE,
const.BINARY_UPGRADE_STEP_UPGRADE_APP)
self.installNewBin()
self.cpDolphinUpgradeScript()
# 11. restore the cluster config. including this:
# cluster_static_config
@ -6908,10 +6909,13 @@ END;"""
self.context.logger.debug("Start to copy dolphin upgrade script.")
try:
cmd = "if ls %s/share/postgresql/extension/ | grep -qE \"dolphin--(.*)--(.*)sql\" ; " \
cmd = "if ls %s/share/postgresql/extension/ | grep -qE 'dolphin--(.*)--(.*)sql' ; " \
"then cp -f %s/share/postgresql/extension/dolphin--*--*sql %s/share/postgresql/extension/; fi" % \
(self.context.oldClusterAppPath, self.context.oldClusterAppPath, self.context.newClusterAppPath)
CmdExecutor.execCommandLocally(cmd)
CmdExecutor.execCommandWithMode(cmd,
self.context.sshTool,
self.context.isSingle,
self.context.mpprcFile)
self.context.logger.debug("Successfully copy dolphin upgrade script.")
except Exception as e:
raise Exception("Failed to copy dolphin upgrade script.")