Closed whitetower957 closed 5 years ago
What is e.Latestrevision
? Keys that created or modified prior to this revision will not be returned in watch channel.
resp, err := e.Cli.Get(timeoutctx, DefaultPrefix, clientv3.WithPrefix())
e.Latestrevision = resp.Header.Revision + 1
I solved it ,because i used channel to transfer the etcd watched events ,it blocks the watch channel i guess.
go func(){
Evchan <- evType
}
I used etcd3 to write golang project on windows10, The problem is when i registered 10 pairs of different key-value,etcd3 watch was only watched 2 pairs of key-value.
I promised 10 key-value were registered.Because i used client.get(context.todo,key) to get the key-value. And 10 pairs of key-value had the same DefaultPrefix and leaseID