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

issue: #35361
pr: #35365

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
wei liu 2024-08-13 10:24:20 +08:00 committed by GitHub
parent b371467604
commit b316040634
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)