Skip to content

Commit 85c1438

Browse files
committed
enhance: Enable to merge sort one segment
Remove the log stack when setting isCompacting Signed-off-by: yangxuan <[email protected]>
1 parent 947c885 commit 85c1438

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

internal/datacoord/segment_info.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
package datacoord
1818

1919
import (
20-
"fmt"
2120
"math"
22-
"runtime/debug"
2321
"time"
2422

2523
"github.com/samber/lo"
@@ -306,8 +304,7 @@ func (s *SegmentsInfo) SetFlushTime(segmentID UniqueID, t time.Time) {
306304

307305
// SetIsCompacting sets compaction status for segment
308306
func (s *SegmentsInfo) SetIsCompacting(segmentID UniqueID, isCompacting bool) {
309-
st := fmt.Sprintf("%s", debug.Stack())
310-
log.Info("set compacting", zap.Int64("segmentID", segmentID), zap.Bool("isCompacting", isCompacting), zap.Any("stacktrace", st))
307+
log.Info("set compacting", zap.Int64("segmentID", segmentID), zap.Bool("isCompacting", isCompacting))
311308
if segment, ok := s.segments[segmentID]; ok {
312309
s.segments[segmentID] = segment.ShadowClone(SetIsCompacting(isCompacting))
313310
}

internal/datanode/compactor/mix_compactor.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ func (t *mixCompactionTask) Compact() (*datapb.CompactionPlanResult, error) {
355355
break
356356
}
357357
}
358-
if len(t.plan.GetSegmentBinlogs()) <= 1 ||
359-
len(t.plan.GetSegmentBinlogs()) > t.compactionParams.MaxSegmentMergeSort {
358+
359+
if len(t.plan.GetSegmentBinlogs()) > t.compactionParams.MaxSegmentMergeSort {
360360
// sort merge is not applicable if there is only one segment or too many segments
361361
sortMergeAppicable = false
362362
}
@@ -365,7 +365,6 @@ func (t *mixCompactionTask) Compact() (*datapb.CompactionPlanResult, error) {
365365
var res []*datapb.CompactionSegment
366366
var err error
367367
if sortMergeAppicable {
368-
// TODO: the implementation of mergeSortMultipleSegments is not correct, also see issue: https://github.com/milvus-io/milvus/issues/43034
369368
log.Info("compact by merge sort")
370369
res, err = mergeSortMultipleSegments(ctxTimeout, t.plan, t.collectionID, t.partitionID, t.maxRows, t.binlogIO,
371370
t.plan.GetSegmentBinlogs(), t.tr, t.currentTime, t.plan.GetCollectionTtl(), t.compactionParams, t.sortByFieldIDs)

0 commit comments

Comments
 (0)