Skip to content

Commit

Permalink
improve: unindexed collection can be compacted
Browse files Browse the repository at this point in the history
Signed-off-by: xiaofanluan <[email protected]>
  • Loading branch information
xiaofan-luan committed Feb 5, 2025
1 parent b3791a6 commit 76d8a78
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/datacoord/compaction_policy_single.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (policy *singleCompactionPolicy) triggerOneCollection(ctx context.Context,
views := make([]CompactionView, 0)
for _, group := range partSegments {
if Params.DataCoordCfg.IndexBasedCompaction.GetAsBool() {
group.segments = FilterInIndexedSegments(policy.handler, policy.meta, false, group.segments...)
group.segments = FilterInIndexedSegments(policy.handler, policy.meta, true, group.segments...)
}

collectionTTL, err := getCollectionTTL(collection.Properties)
Expand Down
4 changes: 2 additions & 2 deletions internal/datacoord/compaction_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func (t *compactionTrigger) handleGlobalSignal(signal *compactionSignal) error {
}

if Params.DataCoordCfg.IndexBasedCompaction.GetAsBool() {
group.segments = FilterInIndexedSegments(t.handler, t.meta, signal.isForce, group.segments...)
group.segments = FilterInIndexedSegments(t.handler, t.meta, true, group.segments...)
}

coll, err := t.getCollection(group.collectionID)
Expand Down Expand Up @@ -625,7 +625,7 @@ func (t *compactionTrigger) generatePlans(segments []*SegmentInfo, signal *compa
func (t *compactionTrigger) getCandidateSegments(channel string, partitionID UniqueID) []*SegmentInfo {
segments := t.meta.GetSegmentsByChannel(channel)
if Params.DataCoordCfg.IndexBasedCompaction.GetAsBool() {
segments = FilterInIndexedSegments(t.handler, t.meta, false, segments...)
segments = FilterInIndexedSegments(t.handler, t.meta, true, segments...)
}

var res []*SegmentInfo
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/garbage_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ func (gc *garbageCollector) recycleDroppedSegments(ctx context.Context) {
droppedCompactTo[to] = struct{}{}
}
}
indexedSegments := FilterInIndexedSegments(gc.handler, gc.meta, false, lo.Keys(droppedCompactTo)...)
indexedSegments := FilterInIndexedSegments(gc.handler, gc.meta, true, lo.Keys(droppedCompactTo)...)
indexedSet := make(typeutil.UniqueSet)
for _, segment := range indexedSegments {
indexedSet.Insert(segment.GetID())
Expand Down

0 comments on commit 76d8a78

Please sign in to comment.