-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Open
Labels
Description
Bug report criteria
- This bug report is not security related, security issues should be disclosed privately via [email protected].
- This is not a support request or question, support requests or questions should be raised in the etcd discussion forums.
- You have read the etcd bug reporting guidelines.
- Existing open issues along with etcd frequently asked questions have been checked and this is not a duplicate.
What happened?
When performing a range request with a limit and sorting by key in ascending order, etcd currently ignores the limit and fetches all matching keys from the backend, then truncates them in memory. This causes unnecessary performance overhead and memory usage.
What did you expect to happen?
The query result is correct, but it would be better if the server retained the limit requested by the user.
How can we reproduce it (as minimally and precisely as possible)?
Execute a query with sort order set to ascending by key. You can't directly observe this bug, but the internal behavior of the server when executing this query is inefficient.
Anything else we need to know?
No response
Etcd version (please run commands below)
$ etcd --version
etcd Version: 3.5.17
Git SHA: 507c0de87
Go Version: go1.23.3
Go OS/Arch: darwin/arm64
$ etcdctl version
etcdctl version: 3.5.17
API version: 3.5
This behavior is also present in 3.6
Etcd configuration (command line flags or environment variables)
paste your configuration here
Etcd debug information (please run commands below, 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