fix: Fix cornor case that segment can't be move out from stopping node (#36431)

issue: #36426
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 <wei.liu@zilliz.com>
pull/36292/head
wei liu 2024-09-24 17:01:14 +08:00 committed by GitHub
parent 52cce4de58
commit 3bd7ec8751
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 6 deletions

View File

@ -941,12 +941,7 @@ func (scheduler *taskScheduler) checkSegmentTaskStale(task *SegmentTask) error {
return merr.WrapErrNodeOffline(action.Node()) return merr.WrapErrNodeOffline(action.Node())
} }
taskType := GetTaskType(task) taskType := GetTaskType(task)
var segment *datapb.SegmentInfo segment := scheduler.targetMgr.GetSealedSegment(task.CollectionID(), task.SegmentID(), meta.CurrentTargetFirst)
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)
}
if segment == nil { if segment == nil {
log.Warn("task stale due to the segment to load not exists in targets", log.Warn("task stale due to the segment to load not exists in targets",
zap.Int64("segment", task.segmentID), zap.Int64("segment", task.segmentID),