From 11eb878dd81c86b463d35aef03b3f8eb568e2d24 Mon Sep 17 00:00:00 2001 From: Fengjingkun Date: Mon, 15 Jul 2024 15:11:31 +0000 Subject: [PATCH] add obtest about minor merge --- deps/oblib/src/lib/utility/ob_tracepoint_def.h | 1 + src/storage/compaction/ob_partition_merge_policy.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/deps/oblib/src/lib/utility/ob_tracepoint_def.h b/deps/oblib/src/lib/utility/ob_tracepoint_def.h index 5a248e885..6334a50e4 100644 --- a/deps/oblib/src/lib/utility/ob_tracepoint_def.h +++ b/deps/oblib/src/lib/utility/ob_tracepoint_def.h @@ -436,6 +436,7 @@ GLOBAL_ERRSIM_POINT_DEF(748, EN_COMPACTION_ITER_SET_BATCH_CNT, ""); // please add new trace point after 750 GLOBAL_ERRSIM_POINT_DEF(751, EN_SESSION_LEAK_COUNT_THRESHOLD, "used to control the threshold of report session leak ERROR"); +GLOBAL_ERRSIM_POINT_DEF(760, EN_DISABLE_TABLET_MINOR_MERGE, "used to stop scheduling minor merge"); GLOBAL_ERRSIM_POINT_DEF(800, EN_END_PARTICIPANT, ""); // compaction 801 - 899 diff --git a/src/storage/compaction/ob_partition_merge_policy.cpp b/src/storage/compaction/ob_partition_merge_policy.cpp index 3e181c6ef..07f606bd9 100644 --- a/src/storage/compaction/ob_partition_merge_policy.cpp +++ b/src/storage/compaction/ob_partition_merge_policy.cpp @@ -491,6 +491,13 @@ int ObPartitionMergePolicy::get_minor_merge_tables( tablet, min_snapshot_version, max_snapshot_version, true /*check_table_cnt*/, true /*is_multi_version_merge*/))) { LOG_WARN("fail to calculate boundary version", K(ret)); + } else { +#ifdef ERRSIM + ret = OB_E(EventTable::EN_DISABLE_TABLET_MINOR_MERGE) OB_SUCCESS; + if (OB_FAIL(ret)) { + FLOG_INFO("Errsim: disable data tablet minor merge", K(ret), "tablet_id", tablet.get_tablet_meta().tablet_id_); + } +#endif } if (OB_FAIL(ret)) {