From 680314ff38853e2befcce5eace3480e9581c1520 Mon Sep 17 00:00:00 2001 From: Kafuu Chino Date: Tue, 2 Aug 2022 18:55:41 +0800 Subject: [PATCH] Fixed unexpected cancel watch which WatchID equal to 0. --- server/storage/mvcc/watchable_store.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/storage/mvcc/watchable_store.go b/server/storage/mvcc/watchable_store.go index 5a201d4edbe7..254e9e2e3a0c 100644 --- a/server/storage/mvcc/watchable_store.go +++ b/server/storage/mvcc/watchable_store.go @@ -108,6 +108,7 @@ func (s *watchableStore) NewWatchStream() WatchStream { return &watchStream{ watchable: s, ch: make(chan WatchResponse, chanBufLen), + nextID: 1, cancels: make(map[WatchID]cancelFunc), watchers: make(map[WatchID]*watcher), }