From 14d1dc022a2de6bee03f0f69169414e7dea08eca Mon Sep 17 00:00:00 2001 From: HaHaJeff Date: Tue, 21 Nov 2023 05:44:44 +0000 Subject: [PATCH] add macro CLUSTER_VERSION_4_2_1_2 --- src/share/ob_cluster_version.h | 2 ++ src/share/ob_upgrade_utils.cpp | 7 +++++-- src/share/ob_upgrade_utils.h | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/share/ob_cluster_version.h b/src/share/ob_cluster_version.h index 4625496cf0..9b9ce67320 100644 --- a/src/share/ob_cluster_version.h +++ b/src/share/ob_cluster_version.h @@ -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)) diff --git a/src/share/ob_upgrade_utils.cpp b/src/share/ob_upgrade_utils.cpp index 7b2397b37d..99a97c936b 100755 --- a/src/share/ob_upgrade_utils.cpp +++ b/src/share/ob_upgrade_utils.cpp @@ -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 diff --git a/src/share/ob_upgrade_utils.h b/src/share/ob_upgrade_utils.h index a93882e378..7bb3dc1b33 100755 --- a/src/share/ob_upgrade_utils.h +++ b/src/share/ob_upgrade_utils.h @@ -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 ============= */