Skip to content

Commit

Permalink
enhance: Skip updating the level that are already at the specified le…
Browse files Browse the repository at this point in the history
…vel (milvus-io#35094)

issue: milvus-io#34495

Signed-off-by: Cai Zhang <[email protected]>
Signed-off-by: Sumit Dubey <[email protected]>
  • Loading branch information
xiaocai2333 authored and sumitd2 committed Aug 6, 2024
1 parent d5675d3 commit dcabc1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/datacoord/compaction_task_clustering.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ func (t *clusteringCompactionTask) BuildCompactionRequest() (*datapb.CompactionP

func (t *clusteringCompactionTask) processPipelining() error {
log := log.With(zap.Int64("triggerID", t.TriggerID), zap.Int64("collectionID", t.GetCollectionID()), zap.Int64("planID", t.GetPlanID()))
if t.NeedReAssignNodeID() {
log.Debug("wait for the node to be assigned before proceeding with the subsequent steps")
return nil
}
var operators []UpdateOperator
for _, segID := range t.InputSegments {
operators = append(operators, UpdateSegmentLevelOperator(segID, datapb.SegmentLevel_L2))
Expand Down
4 changes: 4 additions & 0 deletions internal/datacoord/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,10 @@ func UpdateSegmentLevelOperator(segmentID int64, level datapb.SegmentLevel) Upda
zap.Int64("segmentID", segmentID))
return false
}
if segment.LastLevel == segment.Level && segment.Level == level {
log.Debug("segment already is this level", zap.Int64("segID", segmentID), zap.String("level", level.String()))
return true
}
segment.LastLevel = segment.Level
segment.Level = level
return true
Expand Down

0 comments on commit dcabc1b

Please sign in to comment.