copy upgrade script of dolphin from old appPath to new one

This commit is contained in:
chenxiaobin19 2023-08-23 16:05:46 +08:00
parent fb44126abb
commit 13c45bcfe0

View File

@ -1529,6 +1529,9 @@ class UpgradeImpl:
# prepared in the preinstall
self.installNewBin()
# copy dolphin upgrade script from old appPath to new one
self.cpDolphinUpgradeScript()
# decompress the catalog upgrade_sql.tar.gz to temp dir,
# include upgrade sql file and guc set
self.prepareUpgradeSqlFolder()
@ -6763,6 +6766,23 @@ class UpgradeImpl:
self.context.logger.debug("Failed to install new binary files.")
raise Exception(str(e))
def cpDolphinUpgradeScript(self):
"""
function: copy upgrade script of dolphin from old appPath to new one
input: none
output: none
"""
self.context.logger.debug("Start to copy dolphin upgrade script.")
try:
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)
self.context.logger.debug("Successfully copy dolphin upgrade script.")
except Exception as e:
raise Exception("Failed to copy dolphin upgrade script.")
def backupHotpatch(self):
"""
function: backup hotpatch config file patch.info in xxx/data/hotpatch