432
// FinishedDraining is called by a draining backlog manager when it has fully drained.
433
// This updates the active backlog manager's metadata and unloads the draining manager.
435
>
if !softassert.That(c.logger, c.priMatcher != nil, "FinishedDraining called with old matcher") {
436
return
437
}
438
440
>
drainMgr := c.drainBacklogMgr
441
>
c.drainBacklogMgr = nil
442
>
c.drainBacklogMgrLock.Unlock()
443
>
444
>
// Update active manager's OtherHasTasks field and persist
445
>
ctx, cancel := context.WithTimeout(c.tqCtx, ioTimeout)
446
>
err := c.backlogMgr.getDB().SetOtherHasTasks(ctx, false)
447
>
cancel()
448
>
if err != nil {
449
c.logger.Warn("Failed to sync state after drain completion", tag.Error(err))
450
// Note: we've already cleared drainBacklogMgr, so we won't retry.