diff --git a/server/storage/mvcc/watchable_store.go b/server/storage/mvcc/watchable_store.go index adf07f7755b0..f0d056f286d4 100644 --- a/server/storage/mvcc/watchable_store.go +++ b/server/storage/mvcc/watchable_store.go @@ -448,12 +448,15 @@ func (s *watchableStore) notify(rev int64, evs []mvccpb.Event) { pendingEventsGauge.Add(float64(len(eb.evs))) } else { // move slow watcher to victims - w.minRev = rev + 1 w.victim = true victim[w] = eb s.synced.delete(w) slowWatcherGauge.Inc() } + // always update minRev + // in case 'send' returns true and watcher stays synced, this is needed for Restore when all watchers become unsynced + // in case 'send' returns false, this is needed for syncWatchers + w.minRev = rev + 1 } s.addVictim(victim) }