diff --git a/src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp b/src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp index 04c68c74d..29618c12c 100644 --- a/src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp +++ b/src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp @@ -349,7 +349,7 @@ void ObMicroBlockEncoder::update_estimate_size_limit(const ObMicroBlockEncodingC ? (2 * ctx.micro_block_size_ - header_size_) : (2 * ctx.micro_block_size_); //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); } estimate_size_limit_ = std::min(data_size_limit * expand_pct_ / 100, ctx.macro_block_size_); diff --git a/src/storage/blocksstable/ob_index_block_builder.cpp b/src/storage/blocksstable/ob_index_block_builder.cpp index 66286f924..24a0a2d1c 100644 --- a/src/storage/blocksstable/ob_index_block_builder.cpp +++ b/src/storage/blocksstable/ob_index_block_builder.cpp @@ -838,6 +838,7 @@ void ObSSTableIndexBuilder::clean_status() // release memory to avoid occupying too much if retry frequently self_allocator_.reset(); } + int ObSSTableIndexBuilder::close(const int64_t column_cnt, ObSSTableMergeRes &res) { 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)); } else if (OB_FAIL(sort_roots())) { 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(); if (is_single_block) { switch (optimization_mode_) { @@ -885,6 +887,9 @@ int ObSSTableIndexBuilder::close(const int64_t column_cnt, ObSSTableMergeRes &re break; } } + } else { + res.nested_offset_ = 0; + res.nested_size_ = OB_DEFAULT_MACRO_BLOCK_SIZE; } if (OB_FAIL(ret) || roots_.empty() || is_closed_) { diff --git a/src/storage/blocksstable/ob_macro_block_writer.cpp b/src/storage/blocksstable/ob_macro_block_writer.cpp index 1c4cfa623..c8f2f6ee0 100644 --- a/src/storage/blocksstable/ob_macro_block_writer.cpp +++ b/src/storage/blocksstable/ob_macro_block_writer.cpp @@ -472,7 +472,7 @@ int ObMacroBlockWriter::open( } else { //TODO huronghui.hrh@oceanbase.com use 4.1.0.0 for version judgment 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))) { STORAGE_LOG(WARN, "Failed to init micro block adaptive split", K(ret), K(data_store_desc.macro_store_size_)); }