Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions server/storage/mvcc/watchable_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down