diff --git a/src/storage/compaction/ob_basic_tablet_merge_ctx.cpp b/src/storage/compaction/ob_basic_tablet_merge_ctx.cpp index c1ee3d9034..aaa344870f 100644 --- a/src/storage/compaction/ob_basic_tablet_merge_ctx.cpp +++ b/src/storage/compaction/ob_basic_tablet_merge_ctx.cpp @@ -212,7 +212,7 @@ int ObStaticMergeParam::get_basic_info_from_result( return ret; } -int ObStaticMergeParam::cal_minor_merge_param() +int ObStaticMergeParam::cal_minor_merge_param(const bool has_compaction_filter) { int ret = OB_SUCCESS; //some input param check @@ -221,8 +221,9 @@ int ObStaticMergeParam::cal_minor_merge_param() LOG_WARN("tables handle is invalid", K(ret), K(tables_handle_)); } else { read_base_version_ = 0; - if (get_tablet_id().is_ls_inner_tablet() && !is_mini_merge(get_merge_type())) { + if (get_tablet_id().is_ls_inner_tablet() && has_compaction_filter) { // full merge has been setted when preparing compaction filter + set_full_merge_and_level(true/*is_full_merge*/); } else { set_full_merge_and_level(false/*is_full_merge*/); } diff --git a/src/storage/compaction/ob_basic_tablet_merge_ctx.h b/src/storage/compaction/ob_basic_tablet_merge_ctx.h index deaec28867..2b9a46a7d7 100644 --- a/src/storage/compaction/ob_basic_tablet_merge_ctx.h +++ b/src/storage/compaction/ob_basic_tablet_merge_ctx.h @@ -39,7 +39,7 @@ struct ObStaticMergeParam final OB_INLINE const ObLSID &get_ls_id() const { return dag_param_.ls_id_; } OB_INLINE const ObTabletID &get_tablet_id() const { return dag_param_.tablet_id_; } - int cal_minor_merge_param(); + int cal_minor_merge_param(const bool has_compaction_filter); int cal_major_merge_param(); bool is_build_row_store_from_rowkey_cg() const; bool is_build_row_store() const; @@ -222,7 +222,7 @@ protected: return OB_SUCCESS; } virtual int prepare_schema(); - virtual int cal_merge_param() { return static_param_.cal_minor_merge_param(); } + virtual int cal_merge_param() { return static_param_.cal_minor_merge_param(false/*has_compaction_filter*/); } int init_parallel_merge_ctx(); int init_static_param_and_desc(); int init_read_info(); diff --git a/src/storage/compaction/ob_tablet_merge_ctx.cpp b/src/storage/compaction/ob_tablet_merge_ctx.cpp index 809a9a8435..b70c6bb085 100644 --- a/src/storage/compaction/ob_tablet_merge_ctx.cpp +++ b/src/storage/compaction/ob_tablet_merge_ctx.cpp @@ -347,7 +347,8 @@ int ObTabletExeMergeCtx::get_merge_tables(ObGetMergeTablesResult &get_merge_tabl int ObTabletExeMergeCtx::cal_merge_param() { int ret = OB_SUCCESS; - if (OB_FAIL(static_param_.cal_minor_merge_param())) { + const bool has_compaction_filter = nullptr != info_collector_.compaction_filter_; + if (OB_FAIL(static_param_.cal_minor_merge_param(has_compaction_filter))) { LOG_WARN("failed to cal_major_merge_param", KR(ret)); } else if (is_minor_merge(static_param_.get_merge_type())) { if (OB_FAIL(init_static_param_tx_id())) { @@ -482,10 +483,7 @@ int ObTabletExeMergeCtx::prepare_compaction_filter() FLOG_INFO("success to init compaction filter", K(tmp_ret), K(recycle_scn)); } - if (OB_SUCCESS == tmp_ret) { - static_param_.read_base_version_ = 0; - static_param_.set_full_merge_and_level(true/*is_full_merge*/); - } else if (OB_NOT_NULL(buf)) { + if (OB_SUCCESS != tmp_ret && OB_NOT_NULL(buf)) { mem_ctx_.free(buf); buf = nullptr; }