add compatibility code

This commit is contained in:
obdev
2022-12-19 03:37:50 +00:00
committed by ob-robot
parent c8c7f9b22a
commit cb58b14ae4
3 changed files with 8 additions and 3 deletions

View File

@ -349,7 +349,7 @@ void ObMicroBlockEncoder::update_estimate_size_limit(const ObMicroBlockEncodingC
? (2 * ctx.micro_block_size_ - header_size_) ? (2 * ctx.micro_block_size_ - header_size_)
: (2 * ctx.micro_block_size_); : (2 * ctx.micro_block_size_);
//TODO huronghui.hrh@oceanbase.com use 4.1.0.0 for version judgment //TODO huronghui.hrh@oceanbase.com use 4.1.0.0 for version judgment
if(ctx.major_working_cluster_version_ > CLUSTER_VERSION_4_0_0_0 ) { if(ctx.major_working_cluster_version_ >= CLUSTER_VERSION_4_1_0_0 ) {
data_size_limit = MAX(data_size_limit, DEFAULT_MICRO_MAX_SIZE); data_size_limit = MAX(data_size_limit, DEFAULT_MICRO_MAX_SIZE);
} }
estimate_size_limit_ = std::min(data_size_limit * expand_pct_ / 100, ctx.macro_block_size_); estimate_size_limit_ = std::min(data_size_limit * expand_pct_ / 100, ctx.macro_block_size_);

View File

@ -838,6 +838,7 @@ void ObSSTableIndexBuilder::clean_status()
// release memory to avoid occupying too much if retry frequently // release memory to avoid occupying too much if retry frequently
self_allocator_.reset(); self_allocator_.reset();
} }
int ObSSTableIndexBuilder::close(const int64_t column_cnt, ObSSTableMergeRes &res) int ObSSTableIndexBuilder::close(const int64_t column_cnt, ObSSTableMergeRes &res)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
@ -861,7 +862,8 @@ int ObSSTableIndexBuilder::close(const int64_t column_cnt, ObSSTableMergeRes &re
STORAGE_LOG(DEBUG, "sstable has no data", K(ret)); STORAGE_LOG(DEBUG, "sstable has no data", K(ret));
} else if (OB_FAIL(sort_roots())) { } else if (OB_FAIL(sort_roots())) {
STORAGE_LOG(WARN, "fail to sort roots", K(ret)); STORAGE_LOG(WARN, "fail to sort roots", K(ret));
} else { // TODO GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_4_0_0_0 } else if (!index_store_desc_.is_major_merge()
|| index_store_desc_.major_working_cluster_version_ >= CLUSTER_VERSION_4_1_0_0) {
const bool is_single_block = check_single_block(); const bool is_single_block = check_single_block();
if (is_single_block) { if (is_single_block) {
switch (optimization_mode_) { switch (optimization_mode_) {
@ -885,6 +887,9 @@ int ObSSTableIndexBuilder::close(const int64_t column_cnt, ObSSTableMergeRes &re
break; break;
} }
} }
} else {
res.nested_offset_ = 0;
res.nested_size_ = OB_DEFAULT_MACRO_BLOCK_SIZE;
} }
if (OB_FAIL(ret) || roots_.empty() || is_closed_) { if (OB_FAIL(ret) || roots_.empty() || is_closed_) {

View File

@ -472,7 +472,7 @@ int ObMacroBlockWriter::open(
} else { } else {
//TODO huronghui.hrh@oceanbase.com use 4.1.0.0 for version judgment //TODO huronghui.hrh@oceanbase.com use 4.1.0.0 for version judgment
const bool is_use_adaptive = !data_store_desc_->is_major_merge() const bool is_use_adaptive = !data_store_desc_->is_major_merge()
|| data_store_desc_->major_working_cluster_version_ > CLUSTER_VERSION_4_0_0_0; || data_store_desc_->major_working_cluster_version_ >= CLUSTER_VERSION_4_1_0_0;
if (OB_FAIL(micro_block_adaptive_splitter_.init(data_store_desc.macro_store_size_, is_use_adaptive))) { if (OB_FAIL(micro_block_adaptive_splitter_.init(data_store_desc.macro_store_size_, is_use_adaptive))) {
STORAGE_LOG(WARN, "Failed to init micro block adaptive split", K(ret), K(data_store_desc.macro_store_size_)); STORAGE_LOG(WARN, "Failed to init micro block adaptive split", K(ret), K(data_store_desc.macro_store_size_));
} }