diff --git a/server/storage/mvcc/watchable_store.go b/server/storage/mvcc/watchable_store.go index 7b96f55807c8..a2f0bf33f49e 100644 --- a/server/storage/mvcc/watchable_store.go +++ b/server/storage/mvcc/watchable_store.go @@ -515,15 +515,11 @@ func (s *watchableStore) progressIfSync(watchers map[WatchID]*watcher, responseW s.mu.RLock() defer s.mu.RUnlock() - rev := s.rev() // Any watcher unsynced? for _, w := range watchers { if _, ok := s.synced.watchers[w]; !ok { return false } - if rev < w.startRev { - return false - } } // If all watchers are synchronised, send out progress @@ -532,6 +528,9 @@ func (s *watchableStore) progressIfSync(watchers map[WatchID]*watcher, responseW // notification will be broadcasted client-side if required // (see dispatchEvent in client/v3/watch.go) for _, w := range watchers { + // Use the watcher's minRev - 1 to ensure that we don't send a progress + // notification for a revision that hasn't been notified yet via notify(). + rev := w.minRev - 1 w.send(WatchResponse{WatchID: responseWatchID, Revision: rev}) return true }