1.预安装修改:

因为红旗系统的局限性,导致在第二次预安装的时候,执行输出环境变量的命令执行不了
所以在代码中加上source命令,可以直接执行命令

2.增加获取主dn的日志打印

3.switchover后升级失败:
switchover后,使用gs_om -t refreshconf生成动态文件,但是由于930的解码方式和
1230的解码方式存在差异,导致升级过程中,解读动态文件时错误
This commit is contained in:
gyt0221
2021-01-08 10:53:18 +08:00
parent 55d6d8a34a
commit b6c1650ed4
6 changed files with 107 additions and 17 deletions

View File

@ -1722,6 +1722,31 @@ def restoreConfig():
raise Exception(str(e))
def restoreDynamicConfigFile():
"""
function: restore dynamic config file
output: None
:return:
"""
bakPath = g_opts.upgrade_bak_path
newClusterAppPath = g_opts.newClusterAppPath
oldClusterAppPath = g_opts.oldClusterAppPath
# cp new dynamic config file to new app path
newDynamicConfigFile = "%s/bin/cluster_dynamic_config" % oldClusterAppPath
g_file.removeFile("%s/bin/cluster_dynamic_config" % newClusterAppPath)
cmd = "(if [ -f '%s' ];then cp -f -p '%s' '%s/bin/';fi)" % (
newDynamicConfigFile, newDynamicConfigFile, newClusterAppPath)
g_logger.debug("Restore command: %s" % cmd)
DefaultValue.execCommandLocally(cmd)
# cp old dynamic config file to old app path
dynamic_config = "%s/cluster_dynamic_config" % bakPath
g_file.removeFile(newDynamicConfigFile)
cmd = "(if [ -f '%s' ];then cp -f -p '%s' '%s/bin/';fi)" % (
dynamic_config, dynamic_config, oldClusterAppPath)
g_logger.debug("Restore command: %s" % cmd)
DefaultValue.execCommandLocally(cmd)
def inplaceBackup():
"""
function: backup config
@ -2301,7 +2326,7 @@ def updateCatalog():
if len(dbNode.datanodes) == 0:
continue
dnInst = dbNode.datanodes[0]
primaryDnNode = DefaultValue.getPrimaryNode(g_opts.userProfile)
primaryDnNode, _ = DefaultValue.getPrimaryNode(g_opts.userProfile)
if dnInst.hostname not in primaryDnNode:
continue
break
@ -3039,7 +3064,7 @@ def createPgprocPathMappingFile():
if len(dbNode.datanodes) == 0:
continue
dnInst = dbNode.datanodes[0]
primaryDnNode = DefaultValue.getPrimaryNode(g_opts.userProfile)
primaryDnNode, _ = DefaultValue.getPrimaryNode(g_opts.userProfile)
if dnInst.hostname not in primaryDnNode:
continue
break
@ -3114,7 +3139,7 @@ def createNewCsvFile():
if len(dbNode.datanodes) == 0:
continue
dnInst = dbNode.datanodes[0]
primaryDnNode = DefaultValue.getPrimaryNode(g_opts.userProfile)
primaryDnNode, _ = DefaultValue.getPrimaryNode(g_opts.userProfile)
if dnInst.hostname not in primaryDnNode:
continue
break
@ -3251,7 +3276,8 @@ def main():
const.ACTION_REPLACE_PG_PROC_FILES: replacePgprocFile,
const.ACTION_CREATE_PG_PROC_MAPPING_FILE:
createPgprocPathMappingFile,
const.ACTION_CREATE_NEW_CSV_FILE: createNewCsvFile}
const.ACTION_CREATE_NEW_CSV_FILE: createNewCsvFile,
const.ACTION_RESTORE_DYNAMIC_CONFIG_FILE: restoreDynamicConfigFile}
func = funcs[g_opts.action]
func()
except Exception as e: