[PALF] fix GET_MIN_DATA_VERSION may return -4018

This commit is contained in:
BinChenn
2023-04-26 15:09:35 +00:00
committed by ob-robot
parent 3514f929b6
commit ef51ca80f8
9 changed files with 39 additions and 61 deletions

View File

@ -21,6 +21,8 @@ namespace oceanbase
{
using namespace common;
using namespace palf;
constexpr int64_t palf::LogConfigMeta::LOG_CONFIG_META_VERSION;
constexpr int64_t palf::LogConfigMeta::LOG_CONFIG_META_VERSION_INC;
namespace unittest
{
@ -120,6 +122,12 @@ TEST(TestLogMetaInfos, test_log_config_meta)
const LSN barrier_lsn = LSN(300);
const int64_t barrier_mode_pid = 4;
// Test default version
LogConfigMeta default_config_meta;
EXPECT_EQ(OB_SUCCESS, default_config_meta.generate_for_default(curr_log_proposal_id, prev_config_info, curr_config_info));
EXPECT_TRUE(default_config_meta.is_valid());
EXPECT_EQ(palf::LogConfigMeta::LOG_CONFIG_META_VERSION_INC, default_config_meta.version_);
// Test invalid argument
LogConfigMeta log_config_meta;
EXPECT_EQ(OB_INVALID_ARGUMENT, log_config_meta.generate(curr_log_proposal_id, prev_config_info, curr_config_info,