Can etcd 3.5 watcher read older events? If yes, how? I inserted a few thousand key/values in etcd 3.5 and brought the revision to 75,000. But when I start the watcher to watch from revision 1000, I don’t get any events.
This is the code I have:
cli, err := clientv3.New(clientv3.Config{
Endpoints: []string{"http://localhost:2379"},
DialTimeout: 5 * time.Second,
})
watchChan := cli.Watch(context.Background(), "", clientv3.WithRev(1000))
var count int
startTime := time.Now()
for watchResp := range watchChan {
for range watchResp.Events {
count++
// Print the time taken for every 10 objects
if count%10 == 0 {
duration := time.Since(startTime)
fmt.Printf("Time taken to watch %d objects: %vn", count, duration)
startTime = time.Now()
}
}
}