etcd icon indicating copy to clipboard operation
etcd copied to clipboard

Should we restart client side when it's using watch and etcd restored with a snapshot?

Open likakuli opened this issue 3 years ago • 2 comments

Is this a feature?

My client-side uses etcd client pkg to use its watch func. My problem is when client side is watching etcd, but etcd restored with a snapshot, what should client side to do. Restart client side or just keep running?

It seems that the client side doesn't receive any error about etcd restore and will keep running if we don't restart it manually. Thus may lost some event because the revision in client side may large than real revision in etcd when restored.

likakuli avatar Aug 03 '22 08:08 likakuli

the revision in client side may large than real revision in etcd when restored.

This will never happen, otherwise it's an issue. A follower will not receive a snapshot with older index or revision.

ahrtr avatar Aug 22 '22 01:08 ahrtr

I mean the revision used in etcd client side.

I can reproduce it in k8s.

  1. create a k8s cluster and write some object.
  2. backup etcd
  3. write some object to k8s cluster.
  4. use backup file generated in step 2 to restore k8s etcd
  5. data in kube-apiserver are the same with step 3.

likakuli avatar Sep 02 '22 04:09 likakuli

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 31 '22 23:12 stale[bot]