fix: make grow task stale when node become stopping (#32556)

issue: #30816 #32526
pr: #31487
this PR fix that grow task stuck at stopping node

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
wei liu 2024-04-25 10:47:25 +08:00 committed by GitHub
parent 3352805afb
commit fffbc1e3c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -816,6 +816,10 @@ func (scheduler *taskScheduler) checkSegmentTaskStale(task *SegmentTask) error {
for _, action := range task.Actions() {
switch action.Type() {
case ActionTypeGrow:
if ok, _ := scheduler.nodeMgr.IsStoppingNode(action.Node()); ok {
log.Warn("task stale due to node offline", zap.Int64("segment", task.segmentID))
return merr.WrapErrNodeOffline(action.Node())
}
taskType := GetTaskType(task)
var segment *datapb.SegmentInfo
if taskType == TaskTypeMove || taskType == TaskTypeUpdate {
@ -860,6 +864,10 @@ func (scheduler *taskScheduler) checkChannelTaskStale(task *ChannelTask) error {
for _, action := range task.Actions() {
switch action.Type() {
case ActionTypeGrow:
if ok, _ := scheduler.nodeMgr.IsStoppingNode(action.Node()); ok {
log.Warn("task stale due to node offline", zap.String("channel", task.Channel()))
return merr.WrapErrNodeOffline(action.Node())
}
if scheduler.targetMgr.GetDmChannel(task.collectionID, task.Channel(), meta.NextTargetFirst) == nil {
log.Warn("the task is stale, the channel to subscribe not exists in targets",
zap.String("channel", task.Channel()))