Skip to content

Commit

Permalink
Fix slow watchers event loss after compaction
Browse files Browse the repository at this point in the history
Signed-off-by: Chao Chen <[email protected]>
  • Loading branch information
chaochn47 committed Mar 11, 2024
1 parent d4e6456 commit 7ff1da9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/storage/mvcc/watchable_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,12 @@ func (s *watchableStore) syncWatchers() int {
victims := make(watcherBatch)
wb := newWatcherBatch(wg, evs)
for w := range wg.watchers {
if w.minRev < compactionRev {
// skip the watcher that failed to send compacted watch response due to w.ch is full
// next retry of syncWatchers would try to resend the compacted watch response to w.ch
// TODO prioritize sending compacted watch response over other watch responses with events.
continue
}
w.minRev = curRev + 1

eb, ok := wb[w]
Expand Down

0 comments on commit 7ff1da9

Please sign in to comment.