From bdc59f3b151ad50ca3cfb9dd476a4923787e6166 Mon Sep 17 00:00:00 2001 From: wei liu Date: Wed, 25 Sep 2024 10:13:18 +0800 Subject: [PATCH] fix: Fix cornor case that segment can't be move out from stopping node (#36431) (#36475) issue: #36426 pr: #36431 the old constriant requires only segment on current target can be balanced, which is wrong, and caused that segment can't be move out from stopping node, if it's only exist in next target. by design, stopping balance need to move out all segment on it by balance task, thus the unfair old constriant should be removed. Signed-off-by: Wei Liu --- internal/querycoordv2/task/scheduler.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/querycoordv2/task/scheduler.go b/internal/querycoordv2/task/scheduler.go index 342a3651614c4..c13348641b692 100644 --- a/internal/querycoordv2/task/scheduler.go +++ b/internal/querycoordv2/task/scheduler.go @@ -941,12 +941,7 @@ func (scheduler *taskScheduler) checkSegmentTaskStale(task *SegmentTask) error { return merr.WrapErrNodeOffline(action.Node()) } taskType := GetTaskType(task) - var segment *datapb.SegmentInfo - if taskType == TaskTypeMove || taskType == TaskTypeUpdate { - segment = scheduler.targetMgr.GetSealedSegment(task.CollectionID(), task.SegmentID(), meta.CurrentTarget) - } else { - segment = scheduler.targetMgr.GetSealedSegment(task.CollectionID(), task.SegmentID(), meta.NextTargetFirst) - } + segment := scheduler.targetMgr.GetSealedSegment(task.CollectionID(), task.SegmentID(), meta.CurrentTargetFirst) if segment == nil { log.Warn("task stale due to the segment to load not exists in targets", zap.Int64("segment", task.segmentID),