提交 77bb1d79 编写于 作者: X xj0 提交者: LINGuanRen

upgrade opensource release from 3.1.2 to 3.1.3

上级 eed5fbbf
......@@ -4,7 +4,7 @@ include(cmake/Utils.cmake)
include(cmake/Env.cmake)
project("OceanBase CE"
VERSION 3.1.2
VERSION 3.1.3
DESCRIPTION "OceanBase distributed database system"
HOMEPAGE_URL "https://open.oceanbase.com/"
LANGUAGES CXX C ASM)
......
......@@ -94,11 +94,12 @@ uint64_t cal_version(const uint64_t major, const uint64_t minor, const uint64_t
#define CLUSTER_VERSION_3100 (oceanbase::common::cal_version(3, 1, 0))
#define CLUSTER_VERSION_311 (oceanbase::common::cal_version(3, 1, 1))
#define CLUSTER_VERSION_312 (oceanbase::common::cal_version(3, 1, 2))
#define CLUSTER_VERSION_313 (oceanbase::common::cal_version(3, 1, 3))
#define CLUSTER_VERSION_MAX UINT64_MAX
// FIXME If you update the above version, please update me, CLUSTER_CURRENT_VERSION & ObUpgradeChecker!!!!!!
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#define CLUSTER_CURRENT_VERSION CLUSTER_VERSION_312
#define CLUSTER_CURRENT_VERSION CLUSTER_VERSION_313
#define GET_MIN_CLUSTER_VERSION() (oceanbase::common::ObClusterVersion::get_instance().get_cluster_version())
#define GET_UNIS_CLUSTER_VERSION() (::oceanbase::lib::get_unis_compat_version() ?: GET_MIN_CLUSTER_VERSION())
......
......@@ -31,7 +31,8 @@ namespace share {
#define CALC_CLUSTER_VERSION(major, minor, patch) (((major) << 32) + ((minor) << 16) + (patch))
const uint64_t ObUpgradeChecker::UPGRADE_PATH[CLUTER_VERSION_NUM] = {
CALC_CLUSTER_VERSION(3UL, 1UL, 1UL), //3.1.1
CALC_CLUSTER_VERSION(3UL, 1UL, 2UL) //3.1.2
CALC_CLUSTER_VERSION(3UL, 1UL, 2UL), //3.1.2
CALC_CLUSTER_VERSION(3UL, 1UL, 3UL) //3.1.3
};
bool ObUpgradeChecker::check_cluster_version_exist(const uint64_t version)
......@@ -1088,6 +1089,7 @@ int ObUpgradeProcesserSet::init(ObBaseUpgradeProcessor::UpgradeMode mode, common
// order by cluster version asc
INIT_PROCESSOR_BY_VERSION(3, 1, 1);
INIT_PROCESSOR_BY_VERSION(3, 1, 2);
INIT_PROCESSOR_BY_VERSION(3, 1, 3);
#undef INIT_PROCESSOR_BY_VERSION
inited_ = true;
}
......
......@@ -181,7 +181,7 @@ public:
static bool check_cluster_version_exist(const uint64_t version);
public:
static const int64_t CLUTER_VERSION_NUM = 2;
static const int64_t CLUTER_VERSION_NUM = 3;
static const uint64_t UPGRADE_PATH[CLUTER_VERSION_NUM];
};
......@@ -232,6 +232,7 @@ DEF_SIMPLE_UPGRARD_PROCESSER(2, 2, 76);
DEF_SIMPLE_UPGRARD_PROCESSER(3, 1, 0);
DEF_SIMPLE_UPGRARD_PROCESSER(3, 1, 1);
DEF_SIMPLE_UPGRARD_PROCESSER(3, 1, 2);
DEF_SIMPLE_UPGRARD_PROCESSER(3, 1, 3);
/* =========== upgrade processor end ============= */
......
......@@ -518,7 +518,7 @@ DEF_TIME(get_leader_candidate_rpc_timeout, OB_CLUSTER_PARAMETER, "9s", "[2s, 180
"the time during a get leader candidate rpc request "
"is permitted to execute before it is terminated. Range: [2s, 180s]",
ObParameterAttr(Section::ROOT_SERVICE, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_STR(min_observer_version, OB_CLUSTER_PARAMETER, "3.1.2", "the min observer version",
DEF_STR(min_observer_version, OB_CLUSTER_PARAMETER, "3.1.3", "the min observer version",
ObParameterAttr(Section::ROOT_SERVICE, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(enable_ddl, OB_CLUSTER_PARAMETER, "True",
"specifies whether DDL operation is turned on. "
......
#!/bin/bash
curr_version=$1
dest_version=$2
path=$3
cd $path
# modify CMakeList.txt
sed -i "s/VERSION $curr_version/VERSION $dest_version/g" CMakeLists.txt
# modify min_observer_version
sed -i 's/min_observer_version, OB_CLUSTER_PARAMETER, '\"$curr_version\"'/min_observer_version, OB_CLUSTER_PARAMETER, '\"$dest_version\"'/g' src/share/parameter/ob_parameter_seed.ipp
# modifycluster_vesion
curr_version_temp=`echo $curr_version | sed 's/\.//g'`
curr_version_temp1=`echo $curr_version| sed 's/\./, /g'`
dest_version_temp=`echo $dest_version | sed 's/\.//g'`
dest_version_temp1=`echo $dest_version| sed 's/\./, /g'`
sed -i "/#define CLUSTER_VERSION_$curr_version_temp (oceanbase::common::cal_version($curr_version_temp1))/a\#define CLUSTER_VERSION_$dest_version_temp (oceanbase::common::cal_version($dest_version_temp1))" src/share/ob_cluster_version.h
sed -i "s/define CLUSTER_CURRENT_VERSION CLUSTER_VERSION_$curr_version_temp/define CLUSTER_CURRENT_VERSION CLUSTER_VERSION_$dest_version_temp/g" src/share/ob_cluster_version.h
# modify upgrade script
cd tools/upgrade
python reset_upgrade_scripts.py
cd -
sed -i "s/new_version = '$curr_version'/new_version = '$dest_version'/g" tools/upgrade/upgrade_post_checker.py
# modify mysqltest test set
sed -i "s/$curr_version/$dest_version/g" tools/deploy/mysql_test/r//mysql/system_variable.result
if [[ "$curr_version" > "2.2.70" ]]
then
# modify share/ob_upgrade_utils.h
curr_version_temp1=`echo $curr_version| sed 's/\./, /g'`
oldNum=`cat src/share/ob_upgrade_utils.h |grep 'static const int64_t CLUTER_VERSION_NUM' | awk -F ' = ' '{print $2}' | awk -F';' '{print $1}'`
let newNum=oldNum+1
sed -i "s/static const int64_t CLUTER_VERSION_NUM = $oldNum/static const int64_t CLUTER_VERSION_NUM = $newNum/g" src/share/ob_upgrade_utils.h
sed -i "/DEF_SIMPLE_UPGRARD_PROCESSER($curr_version_temp1)/a\\DEF_SIMPLE_UPGRARD_PROCESSER($dest_version_temp1);" src/share/ob_upgrade_utils.h
# modify share/ob_upgrade_utils.cpp
temp=`echo $curr_version | sed 's/\./UL, /g'`
curr_version_temp2=${temp}UL
temp=`echo $dest_version | sed 's/\./UL, /g'`
dest_version_temp2=${temp}UL
sed -i "s/CALC_CLUSTER_VERSION($curr_version_temp2)/CALC_CLUSTER_VERSION($curr_version_temp2),/g" src/share/ob_upgrade_utils.cpp
sed -i "/CALC_CLUSTER_VERSION($curr_version_temp2)/a\\ CALC_CLUSTER_VERSION($dest_version_temp2) //$dest_version" src/share/ob_upgrade_utils.cpp
sed -i "/INIT_PROCESSOR_BY_VERSION($curr_version_temp1)/a\\ INIT_PROCESSOR_BY_VERSION($dest_version_temp1);" src/share/ob_upgrade_utils.cpp
## modify tools/upgrade/special_upgrade_action_post.py
sed -i "/= actions begin =/a\\ run_upgrade_job(conn, cur, \"$dest_version\")" tools/upgrade/special_upgrade_action_post.py
cd tools/upgrade/
python ./gen_upgrade_scripts.py
cd -
##modify yml file
num1=`echo $dest_version | awk -F'.' '{print $3}'`
let num2=num1+1
last_version=`echo $dest_version | sed "s/\(.*\)$num1/\1$num2/g"`
sed -i "/$dest_version/a\\- version: $dest_version\n can_be_upgraded_to:\n - $last_version" tools/upgrade/oceanbase_upgrade_dep.yml
fi
# modify upgrade case
curr_version_temp1=`echo $curr_version | sed 's/\./_/g'`
echo $curr_version_temp1 >> tools/obtest/observer.list
num=`ls -l tools/obtest/t/compat_farm/*.test | wc -l`
if [[ $num = 1 ]]
then
old_version=`ls tools/obtest/t/compat_farm/upgrade_from_*_lite.test | sed 's/tools\/obtest\/t\/compat_farm\/upgrade_from_\(.*\)_lite.test/\1/g'`
mv tools/obtest/t/compat_farm/upgrade_from_${old_version}_lite.test tools/obtest/t/compat_farm/upgrade_from_${curr_version_temp1}_lite.test
mv tools/obtest/r/compat_farm/upgrade_from_${old_version}_lite.result tools/obtest/r/compat_farm/upgrade_from_${curr_version_temp1}_lite.result
sed -i s/version=$old_version/version=$curr_version_temp1/g tools/obtest/t/compat_farm/upgrade_from_${curr_version_temp1}_lite.test
sed -i s/version=$old_version/version=$curr_version_temp1/g tools/obtest/r/compat_farm/upgrade_from_${curr_version_temp1}_lite.result
else
echo "compat_farm has more than one case, please confirm!"
exit 1
fi
......@@ -23,3 +23,6 @@
- version: 3.1.2
can_be_upgraded_to:
- 3.1.3
- version: 3.1.3
can_be_upgraded_to:
- 3.1.4
......@@ -17,7 +17,7 @@ def do_special_upgrade(conn, cur, tenant_id_list, user, pwd):
#因为基准版本更新的时候会调用reset_upgrade_scripts.py来清空actions begin和actions end
#这两行之间的这些代码,如果不写在这两行之间的话会导致清空不掉相应的代码。
####========******####======== actions begin ========####******========####
run_upgrade_job(conn, cur, "3.1.2")
run_upgrade_job(conn, cur, "3.1.3")
return
####========******####========= actions end =========####******========####
......
......@@ -6279,7 +6279,7 @@
##因为基准版本更新的时候会调用reset_upgrade_scripts.py来清空actions begin和actions end
##这两行之间的这些代码,如果不写在这两行之间的话会导致清空不掉相应的代码。
#####========******####======== actions begin ========####******========####
# run_upgrade_job(conn, cur, "3.1.2")
# run_upgrade_job(conn, cur, "3.1.3")
# return
#####========******####========= actions end =========####******========####
#
......@@ -8569,7 +8569,7 @@
#
#class UpgradeParams:
# log_filename = 'upgrade_post_checker.log'
# new_version = '3.1.2'
# new_version = '3.1.3'
##### --------------start : my_error.py --------------
#class MyError(Exception):
# def __init__(self, value):
......
......@@ -12,7 +12,7 @@ import time
class UpgradeParams:
log_filename = 'upgrade_post_checker.log'
new_version = '3.1.2'
new_version = '3.1.3'
#### --------------start : my_error.py --------------
class MyError(Exception):
def __init__(self, value):
......
......@@ -6279,7 +6279,7 @@
##因为基准版本更新的时候会调用reset_upgrade_scripts.py来清空actions begin和actions end
##这两行之间的这些代码,如果不写在这两行之间的话会导致清空不掉相应的代码。
#####========******####======== actions begin ========####******========####
# run_upgrade_job(conn, cur, "3.1.2")
# run_upgrade_job(conn, cur, "3.1.3")
# return
#####========******####========= actions end =========####******========####
#
......@@ -8569,7 +8569,7 @@
#
#class UpgradeParams:
# log_filename = 'upgrade_post_checker.log'
# new_version = '3.1.2'
# new_version = '3.1.3'
##### --------------start : my_error.py --------------
#class MyError(Exception):
# def __init__(self, value):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册