enhance: Enable to merge sort one segment (#45652)

Remove the log stack when setting isCompacting

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
This commit is contained in:
XuanYang-cn 2025-11-19 15:21:05 +08:00 committed by GitHub
parent c8073eb90b
commit 40fdf1e828
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -355,8 +355,8 @@ func (t *mixCompactionTask) Compact() (*datapb.CompactionPlanResult, error) {
break break
} }
} }
if len(t.plan.GetSegmentBinlogs()) <= 1 ||
len(t.plan.GetSegmentBinlogs()) > t.compactionParams.MaxSegmentMergeSort { if len(t.plan.GetSegmentBinlogs()) > t.compactionParams.MaxSegmentMergeSort {
// sort merge is not applicable if there is only one segment or too many segments // sort merge is not applicable if there is only one segment or too many segments
sortMergeAppicable = false sortMergeAppicable = false
} }
@ -365,7 +365,6 @@ func (t *mixCompactionTask) Compact() (*datapb.CompactionPlanResult, error) {
var res []*datapb.CompactionSegment var res []*datapb.CompactionSegment
var err error var err error
if sortMergeAppicable { if sortMergeAppicable {
// TODO: the implementation of mergeSortMultipleSegments is not correct, also see issue: https://github.com/milvus-io/milvus/issues/43034
log.Info("compact by merge sort") log.Info("compact by merge sort")
res, err = mergeSortMultipleSegments(ctxTimeout, t.plan, t.collectionID, t.partitionID, t.maxRows, t.binlogIO, res, err = mergeSortMultipleSegments(ctxTimeout, t.plan, t.collectionID, t.partitionID, t.maxRows, t.binlogIO,
t.plan.GetSegmentBinlogs(), t.tr, t.currentTime, t.plan.GetCollectionTtl(), t.compactionParams, t.sortByFieldIDs) t.plan.GetSegmentBinlogs(), t.tr, t.currentTime, t.plan.GetCollectionTtl(), t.compactionParams, t.sortByFieldIDs)