add macro CLUSTER_VERSION_4_2_1_2

This commit is contained in:
HaHaJeff
2023-11-21 05:44:44 +00:00
committed by ob-robot
parent 4d7b5bd6c3
commit 14d1dc022a
3 changed files with 10 additions and 4 deletions

View File

@ -171,6 +171,7 @@ cal_version(const uint64_t major, const uint64_t minor, const uint64_t major_pat
#define CLUSTER_VERSION_4_2_0_0 (oceanbase::common::cal_version(4, 2, 0, 0))
#define CLUSTER_VERSION_4_2_1_0 (oceanbase::common::cal_version(4, 2, 1, 0))
#define CLUSTER_VERSION_4_2_1_1 (oceanbase::common::cal_version(4, 2, 1, 1))
#define CLUSTER_VERSION_4_2_1_2 (oceanbase::common::cal_version(4, 2, 1, 2))
#define CLUSTER_VERSION_4_2_2_0 (oceanbase::common::cal_version(4, 2, 2, 0))
#define CLUSTER_VERSION_4_3_0_0 (oceanbase::common::cal_version(4, 3, 0, 0))
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -191,6 +192,7 @@ cal_version(const uint64_t major, const uint64_t minor, const uint64_t major_pat
#define DATA_VERSION_4_2_0_0 (oceanbase::common::cal_version(4, 2, 0, 0))
#define DATA_VERSION_4_2_1_0 (oceanbase::common::cal_version(4, 2, 1, 0))
#define DATA_VERSION_4_2_1_1 (oceanbase::common::cal_version(4, 2, 1, 1))
#define DATA_VERSION_4_2_1_2 (oceanbase::common::cal_version(4, 2, 1, 2))
#define DATA_VERSION_4_2_2_0 (oceanbase::common::cal_version(4, 2, 2, 0))
#define DATA_VERSION_4_3_0_0 (oceanbase::common::cal_version(4, 3, 0, 0))

View File

@ -37,7 +37,7 @@ using namespace sql;
namespace share
{
const uint64_t ObUpgradeChecker::UPGRADE_PATH[DATA_VERSION_NUM] = {
const uint64_t ObUpgradeChecker::UPGRADE_PATH[] = {
CALC_VERSION(4UL, 0UL, 0UL, 0UL), // 4.0.0.0
CALC_VERSION(4UL, 1UL, 0UL, 0UL), // 4.1.0.0
CALC_VERSION(4UL, 1UL, 0UL, 1UL), // 4.1.0.1
@ -45,6 +45,7 @@ const uint64_t ObUpgradeChecker::UPGRADE_PATH[DATA_VERSION_NUM] = {
CALC_VERSION(4UL, 2UL, 0UL, 0UL), // 4.2.0.0
CALC_VERSION(4UL, 2UL, 1UL, 0UL), // 4.2.1.0
CALC_VERSION(4UL, 2UL, 1UL, 1UL), // 4.2.1.1
CALC_VERSION(4UL, 2UL, 1UL, 2UL), // 4.2.1.2
CALC_VERSION(4UL, 2UL, 2UL, 0UL), // 4.2.2.0
CALC_VERSION(4UL, 3UL, 0UL, 0UL) // 4.3.0.0
};
@ -67,6 +68,7 @@ int ObUpgradeChecker::get_data_version_by_cluster_version(
CONVERT_CLUSTER_VERSION_TO_DATA_VERSION(CLUSTER_VERSION_4_2_0_0, DATA_VERSION_4_2_0_0)
CONVERT_CLUSTER_VERSION_TO_DATA_VERSION(CLUSTER_VERSION_4_2_1_0, DATA_VERSION_4_2_1_0)
CONVERT_CLUSTER_VERSION_TO_DATA_VERSION(CLUSTER_VERSION_4_2_1_1, DATA_VERSION_4_2_1_1)
CONVERT_CLUSTER_VERSION_TO_DATA_VERSION(CLUSTER_VERSION_4_2_1_2, DATA_VERSION_4_2_1_2)
CONVERT_CLUSTER_VERSION_TO_DATA_VERSION(CLUSTER_VERSION_4_2_2_0, DATA_VERSION_4_2_2_0)
CONVERT_CLUSTER_VERSION_TO_DATA_VERSION(CLUSTER_VERSION_4_3_0_0, DATA_VERSION_4_3_0_0)
#undef CONVERT_CLUSTER_VERSION_TO_DATA_VERSION
@ -82,7 +84,7 @@ bool ObUpgradeChecker::check_data_version_exist(
const uint64_t version)
{
bool bret = false;
OB_ASSERT(DATA_VERSION_NUM == ARRAYSIZEOF(UPGRADE_PATH));
STATIC_ASSERT(DATA_VERSION_NUM == ARRAYSIZEOF(UPGRADE_PATH), "data version count not match!!!");
for (int64_t i = 0; !bret && i < ARRAYSIZEOF(UPGRADE_PATH); i++) {
bret = (version == UPGRADE_PATH[i]);
}
@ -628,6 +630,7 @@ int ObUpgradeProcesserSet::init(
INIT_PROCESSOR_BY_VERSION(4, 2, 0, 0);
INIT_PROCESSOR_BY_VERSION(4, 2, 1, 0);
INIT_PROCESSOR_BY_VERSION(4, 2, 1, 1);
INIT_PROCESSOR_BY_VERSION(4, 2, 1, 2);
INIT_PROCESSOR_BY_VERSION(4, 2, 2, 0);
INIT_PROCESSOR_BY_VERSION(4, 3, 0, 0);
#undef INIT_PROCESSOR_BY_VERSION

View File

@ -170,8 +170,8 @@ public:
const uint64_t cluster_version,
uint64_t &data_version);
public:
static const int64_t DATA_VERSION_NUM = 9;
static const uint64_t UPGRADE_PATH[DATA_VERSION_NUM];
static const int64_t DATA_VERSION_NUM = 10;
static const uint64_t UPGRADE_PATH[];
};
/* =========== special upgrade processor start ============= */
@ -211,6 +211,7 @@ private:
DEF_SIMPLE_UPGRARD_PROCESSER(4, 2, 1, 0)
DEF_SIMPLE_UPGRARD_PROCESSER(4, 2, 1, 1)
DEF_SIMPLE_UPGRARD_PROCESSER(4, 2, 1, 2)
DEF_SIMPLE_UPGRARD_PROCESSER(4, 2, 2, 0)
DEF_SIMPLE_UPGRARD_PROCESSER(4, 3, 0, 0)
/* =========== special upgrade processor end ============= */