From 962c70c0b1c63386c6e1060bebfa6266436f27e6 Mon Sep 17 00:00:00 2001 From: Little-Wallace Date: Tue, 30 Jan 2024 17:17:58 +0800 Subject: [PATCH] fix comment Signed-off-by: Little-Wallace --- .../hummock/compaction/picker/emergency_compaction_picker.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/meta/src/hummock/compaction/picker/emergency_compaction_picker.rs b/src/meta/src/hummock/compaction/picker/emergency_compaction_picker.rs index a5caef8b53379..4efcca28a981c 100644 --- a/src/meta/src/hummock/compaction/picker/emergency_compaction_picker.rs +++ b/src/meta/src/hummock/compaction/picker/emergency_compaction_picker.rs @@ -73,6 +73,9 @@ impl EmergencyCompactionPicker { && level.vnode_partition_count > 0 }) .count(); + // We trigger `EmergencyCompactionPicker` only when some unexpected condition cause the number of l0 levels increase and the origin strategy + // can not compact those data to lower level. But if most of these levels are overlapping level, it is dangerous to compact small data of non-overlapping sub level + // to base level, it will cost a lot of compactor resource because of large write-amplification. if (self.config.split_weight_by_vnode == 0 && no_overlap_count > overlapping_count) || (self.config.split_weight_by_vnode > 0 && partitioned_count > no_overlap_count