-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Filtering GET request via With{Min,Max}{Create,Mod}Rev has wrong result Count #18267
Comments
Hey, we looked at this issue during today's Triage meeting. One of the reviewers needs to work on reproducing it, which isn't assigned yet. Will keep you posted! |
Thanks for the update. My team has a workaround in place in our code that uses etcd, so no rush from our side. |
Thanks for reporting this issue. It's valid bug. The etcd/api/etcdserverpb/rpc.pb.go Line 533 in 010d462
|
Thanks, I had missed that. |
See #18268 (comment) |
Discussed during sig-etcd triage meeting - Let's reframe this issue as a docs update and progress that in the short term. @ahrtr which docs page do you think this best fits under? |
It should be https://etcd.io/docs/v3.5/dev-guide/api_reference_v3/. We should update the comment for the field etcd/api/etcdserverpb/rpc.proto Lines 510 to 511 in 68e7122
|
Bug report criteria
What happened?
What did you expect to happen?
Count
in the GET request's result should be consistent with the size of the kvs array returned.How can we reproduce it (as minimally and precisely as possible)?
See "what happened" above.
Anything else we need to know?
The bug seems to be in
etc/server/etcdserver/txn/txn.go
. When the filtering is applied:etcd/server/etcdserver/txn/txn.go
Line 181 in 37cbd6c
the implementation of
pruneKvs
does update the resulting array of kvsetcd/server/etcdserver/txn/txn.go
Line 483 in 37cbd6c
but the count is set without taking into account the actual returned kvs that may have been filtered:
etcd/server/etcdserver/txn/txn.go
Line 240 in 37cbd6c
Etcd version (please run commands below)
Etcd configuration (command line flags or environment variables)
Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
Relevant log output
No response
The text was updated successfully, but these errors were encountered: