enhance: Enable mergeSort by default starting from version 2.6.0 (#42981)

issue: #42980 

Enable mergeSort for mix compaction to reduce sort stats tasks.

---------

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2025-06-30 21:46:43 +08:00 committed by GitHub
parent ecb24e7232
commit c82943dca1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -758,7 +758,7 @@ dataNode:
compaction:
levelZeroBatchMemoryRatio: 0.5 # The minimal memory ratio of free memory for level zero compaction executing in batch mode
levelZeroMaxBatchSize: -1 # Max batch size refers to the max number of L1/L2 segments in a batch when executing L0 compaction. Default to -1, any value that is less than 1 means no limit. Valid range: >= 1.
useMergeSort: false # Whether to enable mergeSort mode when performing mixCompaction.
useMergeSort: true # Whether to enable mergeSort mode when performing mixCompaction.
maxSegmentMergeSort: 30 # The maximum number of segments to be merged in mergeSort mode.
gracefulStopTimeout: 1800 # seconds. force stop node without graceful stop
slot:

View File

@ -5524,8 +5524,9 @@ if this parameter <= 0, will set it as 10`,
Key: "dataNode.compaction.useMergeSort",
Version: "2.5.0",
Doc: "Whether to enable mergeSort mode when performing mixCompaction.",
DefaultValue: "false",
Export: true,
DefaultValue: "true",
// Enable by default start from 2.6.0
Export: true,
}
p.UseMergeSort.Init(base.mgr)

View File

@ -599,8 +599,7 @@ class TestCompactionOperation(TestcaseBase):
collection_w.wait_for_compaction_completed()
c_plans = collection_w.get_compaction_plans(check_task=CheckTasks.check_merge_compact)[0]
old_segmentIDs = [c_plans.plans[0].target]
old_segmentIDs.extend(c_plans.plans[0].sources)
old_segmentIDs = c_plans.plans[0].sources
# waiting for handoff completed and search
cost = 180
start = time()