Skip to content

Commit

Permalink
fix watch keyspace (tikv#6528)
Browse files Browse the repository at this point in the history
close tikv#6527

Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
  • Loading branch information
AmoebaProtozoa authored and rleungx committed Aug 2, 2023
1 parent 1fbd6f5 commit 558037e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/keyspace_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (s *KeyspaceServer) WatchKeyspaces(request *keyspacepb.WatchKeyspacesReques
}
ctx, cancel := context.WithCancel(s.Context())
defer cancel()
startKey := path.Join(s.rootPath, endpoint.KeyspaceMetaPrefix())
startKey := path.Join(s.rootPath, endpoint.KeyspaceMetaPrefix()) + "/"

keyspaces := make([]*keyspacepb.KeyspaceMeta, 0)
putFn := func(kv *mvccpb.KeyValue) error {
Expand Down Expand Up @@ -106,7 +106,7 @@ func (s *KeyspaceServer) WatchKeyspaces(request *keyspacepb.WatchKeyspacesReques
putFn,
deleteFn,
postEventFn,
clientv3.WithPrefix(),
clientv3.WithRange(clientv3.GetPrefixRangeEnd(startKey)),
)
s.serverLoopWg.Add(1)
go watcher.StartWatchLoop()
Expand Down

0 comments on commit 558037e

Please sign in to comment.