fix: force update next target if target can't be loaded (#35365)

issue: #35361

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
pull/35497/head
wei liu 2024-08-15 19:15:00 +08:00 committed by GitHub
parent b4b1ed6910
commit f6aaf3fef2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -821,6 +821,12 @@ func (scheduler *taskScheduler) remove(task Task) {
zap.Int64("replicaID", task.ReplicaID()),
zap.String("status", task.Status()),
)
if errors.Is(task.Err(), merr.ErrSegmentNotFound) {
log.Info("segment in target has been cleaned, trigger force update next target", zap.Int64("collectionID", task.CollectionID()))
scheduler.targetMgr.UpdateCollectionNextTarget(task.CollectionID())
}
task.Cancel(nil)
scheduler.tasks.Remove(task.ID())
scheduler.waitQueue.Remove(task)