1 Star 0 Fork 22

xiaochn/opengauss-server

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
upgrade.patch 5.44 KB
Copy Edit Raw Blame History
liuheng authored 2024-06-05 17:28 . fix opengauss upgrade
diff -crN '--exclude=.git' '--exclude=.gitee' '--exclude=.vscode' openGauss-server-5.0.1/liteom/upgrade_common.sh openGauss-server-5.0.1-edit/liteom/upgrade_common.sh
*** openGauss-server-5.0.1/liteom/upgrade_common.sh 2024-05-09 14:48:32.000000000 +0800
--- openGauss-server-5.0.1-edit/liteom/upgrade_common.sh 2024-06-07 17:31:52.228407016 +0800
***************
*** 273,284 ****
}
function check_version() {
- if [[ ! -f "${GAUSSHOME}/version.cfg" ]]; then
- die "Cannot find current version.cfg!" ${err_upgrade_pre}
- else
- old_version=$(tail -n 1 "$GAUSSHOME"/version.cfg)
- old_cfg=$(sed -n 2p "$GAUSSHOME"/version.cfg | sed 's/\.//g')
- fi
if [[ -f "$GAUSS_UPGRADE_BIN_PATH"/version.cfg ]]; then
new_version_cfg_path="${GAUSS_UPGRADE_BIN_PATH}/version.cfg"
elif [[ -f "$GAUSS_UPGRADE_BASE_PATH"/version.cfg ]]; then
--- 273,278 ----
***************
*** 290,333 ****
new_version=$(tail -n 1 "$new_version_cfg_path")
new_cfg=$(sed -n 2p "$new_version_cfg_path" | sed 's/\.//g')
- if [[ X"$old_version" == X || X"$old_cfg" == X || X"$new_version" == X || X"$new_cfg" == X ]]; then
- die "Maybe version.cfg is not normal" ${err_upgrade_pre}
- fi
- if ! echo "$old_cfg"|grep -Ewq "[0-9]{3,6}";then
- die "Maybe version.cfg is not normal" ${err_upgrade_pre}
- fi
if ! echo "$new_cfg"|grep -Ewq "[0-9]{3,6}";then
die "Maybe version.cfg is not normal" ${err_upgrade_pre}
fi
! if [[ "$old_version" == "$new_version" ]]; then
! die "New version is same as old, the commitId is $old_version!" ${err_version_same}
! fi
! if [[ ${new_cfg} -lt ${old_cfg} ]]; then
! die "Current version is newer!" ${err_upgrade_pre}
! fi
! big_cfg="False"
! if [[ ${new_cfg} -gt ${old_cfg} ]]; then
! log "Big upgrade is needed!"
! big_cfg="True"
! fi
local flag_file="$GAUSS_TMP_PATH"/version_flag
- if echo "old_version=$old_version" > "$flag_file" && chmod 600 "$flag_file"; then
- debug "Begin to generate $flag_file"
- else
- die "Write $flag_file failed" ${err_upgrade_pre}
- fi
if ! echo "new_version=$new_version" >> "$flag_file"; then
die "Write $flag_file failed" ${err_upgrade_pre}
fi
if ! echo "big_cfg=$big_cfg" >> "$flag_file"; then
die "Write $flag_file failed" ${err_upgrade_pre}
fi
- if ! echo "old_cfg=$old_cfg" >> "$flag_file"; then
- die "Write $flag_file failed" ${err_upgrade_pre}
- fi
- log "Old version commitId is $old_version, version info is $old_cfg"
log "New version commitId is $new_version, version info is $new_cfg"
##need version.cfg to check big upgrade,note user exec sql on primary dn
--- 284,302 ----
new_version=$(tail -n 1 "$new_version_cfg_path")
new_cfg=$(sed -n 2p "$new_version_cfg_path" | sed 's/\.//g')
if ! echo "$new_cfg"|grep -Ewq "[0-9]{3,6}";then
die "Maybe version.cfg is not normal" ${err_upgrade_pre}
fi
! big_cfg="True"
local flag_file="$GAUSS_TMP_PATH"/version_flag
if ! echo "new_version=$new_version" >> "$flag_file"; then
die "Write $flag_file failed" ${err_upgrade_pre}
fi
if ! echo "big_cfg=$big_cfg" >> "$flag_file"; then
die "Write $flag_file failed" ${err_upgrade_pre}
fi
log "New version commitId is $new_version, version info is $new_cfg"
##need version.cfg to check big upgrade,note user exec sql on primary dn
***************
*** 1239,1242 ****
fi
rm -f "$GAUSS_TMP_PATH"/version_flag
rm -f "$GAUSS_TMP_PATH"/record_step.txt
! }
\ No newline at end of file
--- 1208,1211 ----
fi
rm -f "$GAUSS_TMP_PATH"/version_flag
rm -f "$GAUSS_TMP_PATH"/record_step.txt
! }
diff -crN '--exclude=.git' '--exclude=.gitee' '--exclude=.vscode' openGauss-server-5.0.1/liteom/upgrade_config.sh openGauss-server-5.0.1-edit/liteom/upgrade_config.sh
*** openGauss-server-5.0.1/liteom/upgrade_config.sh 2024-05-09 14:48:32.000000000 +0800
--- openGauss-server-5.0.1-edit/liteom/upgrade_config.sh 2024-06-06 16:56:26.681705002 +0800
***************
*** 4,31 ****
# version: 1.0
# 数据库监听端口
! GAUSS_LISTEN_PORT=""
# 数据库管理员用户名
! GAUSS_ADMIN_USER=""
#数据库升级回退日志路径
! GAUSS_LOG_PATH=""
#数据库升级根位置
! GAUSS_UPGRADE_BASE_PATH=""
#数据库SQL包位置
! GAUSS_SQL_TAR_PATH=""
#数据库低版本备份位置
! GAUSS_BACKUP_BASE_PATH=""
#数据库临时目录
! GAUSS_TMP_PATH=""
#是否使用存在的bin解压包
GAUSS_UPGRADE_BIN_PATH=""
#需要同步的cluster config 列表
! GAUSS_UPGRADE_SYNC_CONFIG_LIST=""
\ No newline at end of file
--- 4,31 ----
# version: 1.0
# 数据库监听端口
! GAUSS_LISTEN_PORT="7654"
# 数据库管理员用户名
! GAUSS_ADMIN_USER="opengauss"
#数据库升级回退日志路径
! GAUSS_LOG_PATH="/usr/local/opengauss_upgrade"
#数据库升级根位置
! GAUSS_UPGRADE_BASE_PATH="/usr/local/opengauss_upgrade/pkg_5.0.1"
#数据库SQL包位置
! GAUSS_SQL_TAR_PATH="/usr/local/opengauss_upgrade/pkg_5.0.1"
#数据库低版本备份位置
! GAUSS_BACKUP_BASE_PATH="/usr/local/opengauss_upgrade/bak"
#数据库临时目录
! GAUSS_TMP_PATH="/usr/local/opengauss_upgrade/tmp"
#是否使用存在的bin解压包
GAUSS_UPGRADE_BIN_PATH=""
#需要同步的cluster config 列表
! GAUSS_UPGRADE_SYNC_CONFIG_LIST=""
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiaochn/opengauss-server.git
git@gitee.com:xiaochn/opengauss-server.git
xiaochn
opengauss-server
opengauss-server
master

Search