valkeyrie icon indicating copy to clipboard operation
valkeyrie copied to clipboard

etcd: try put again when ch had closed

Open veloting opened this issue 3 years ago • 4 comments

veloting avatar Jul 28 '22 10:07 veloting

Hello,

can you provide more information about the problem that solve your PR?

ldez avatar Jul 28 '22 10:07 ldez

@ldez etcd lease will expire when there is a problem with the network or etcd server that more than keepalive ttl. the ch will close when keepalive had a problem, maybe it's better to try to put until the network or etcd server is ok

veloting avatar Jul 28 '22 11:07 veloting

1.put(key, value, opt.keepalive=true) to etcd 2. kill etcd server 3. wait for 30s 4. start etcd server

problem: 5. the key will not exist in the etcd server

expect: 5 the (key, value) will put again in etcd server

veloting avatar Jul 28 '22 11:07 veloting

@ldez should i provide more information?

veloting avatar Aug 08 '22 02:08 veloting

I think it's not the right solution to implement a naive retry. The topic needs to be dug more.

We changed the core system of Valkeyrie: now the stores have dedicated repositories.

The new repository for etcdv3: https://github.com/kvtools/etcdv3

I recommend creating an issue about the topic in this repository.

ldez avatar Sep 08 '22 15:09 ldez

@ldez thank you for your reply but if the keepalive channel is closed the key will expired later the put caller need run a new more goroutine to check the key is expired

veloting avatar Sep 09 '22 08:09 veloting