Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision in response header might not reflect data in the body #13989

Open
lavacat opened this issue Apr 25, 2022 · 2 comments
Open

Revision in response header might not reflect data in the body #13989

lavacat opened this issue Apr 25, 2022 · 2 comments

Comments

@lavacat
Copy link

lavacat commented Apr 25, 2022

What happened?

Related to #13940

In LeaseLeases function, newHeader is called at the end and there is no synchronization.
https://github.com/etcd-io/etcd/blob/main/server/etcdserver/v3_server.go#L399

This can cause a situation when list of leases in the body doesn't include new lease reported by revision in the header.

The same is true for any other function that's using newHeader

What did you expect to happen?

Expected Revision in the header to be the latest revision among return leases

How can we reproduce it (as minimally and precisely as possible)?

might be hard to reproduce
try running TestLeaseGrantAndList

Anything else we need to know?

No response

Etcd version (please run commands below)

3.6 latest main branch

Etcd configuration (command line flags or environment variables)

paste your configuration here

Etcd debug information (please run commands blow, feel free to obfuscate the IP address or FQDN in the output)

$ etcdctl member list -w table
# paste output here

$ etcdctl --endpoints=<member list> endpoint status -w table
# paste output here

Relevant log output

No response

@lavacat
Copy link
Author

lavacat commented Apr 25, 2022

Not sure there is nice fix for this. If we move newHeader to the start of the function, the problem is reversed.

IMO, revision in the header should be the latest revision in the data

@stale
Copy link

stale bot commented Jul 31, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants