etcd-io / etcd-io/etcd

A `RangeRequest` with `keys_only` no longer includes `lease` in the response

Open
#22,209 3 comments 0 reactions 1 assignee Claimed by @nwnt View on GitHub
type/bug
Dominant language
Go
Stars
52.3k
Forks
10.5k
Avg merge
3d 1h
Merged PRs (30d)
44

Description

### Bug report criteria

- [x] This bug report is not security related, security issues should be disclosed privately via security@etcd.io.
- [x] This is not a support request or question, support requests or questions should be raised in the etcd [discussion forums](https://github.com/etcd-io/etcd/discussions).
- [x] You have read the etcd [bug reporting guidelines](https://github.com/etcd-io/etcd/blob/main/Documentation/contributor-guide/reporting_bugs.md).
- [x] Existing open issues along with etcd [frequently asked questions](https://etcd.io/docs/latest/faq) have been checked and this is not a duplicate.

### What happened?

When `keys_only: true` is set in a `RangeRequest` the response no longer includes the `lease` field in v3.7. The field is returned in v3.6.

### What did you expect to happen?

I would expect the behavior in v3.7 to remain the same as in v3.6 unless otherwise noted in the changelog. If the new behavior is intended I can work around that, I just figured I should flag it since I didn't see it mentioned anywhere.

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

v3.6.12:
```console
$ etcdctl lease grant 600
lease 694d9fa880a84203 granted with TTL(600s)
$ etcdctl put /test-key value --lease=694d9fa880a84203
OK
$ etcdctl get --keys-only /test-key --write-out=json
{"header":{..},"kvs":[{"key":"L3Rlc3Qta2V5","create_revision":2,"mod_revision":2,"version":1,"lease":7587896493250986499}],"count":1}
```

v3.7.1:
```console
$ etcdctl lease grant 600
lease 694d9fa882852303 granted with TTL(600s)
$ etcdctl put /test-key value --lease=694d9fa882852303
OK
$ etcdctl get --keys-only /test-key --write-out=json
{"header":{..},"kvs":[{"key":"L3Rlc3Qta2V5","create_revision":2,"mod_revision":2,"version":1}],"count":1}
```

### Anything else we need to know?

The change seems to have been introduced by https://github.com/etcd-io/etcd/pull/21791.

### Etcd version (please run commands below)

```console
$ etcd --version
etcd Version: 3.7.1
Git SHA: 5e7fd0d
Go Version: go1.26.5
Go OS/Arch: linux/amd64

$ etcdctl version
etcdctl version: 3.7.1
API version: 3.7
```

### Etcd configuration (command line flags or environment variables)

podman run --rm quay.io/coreos/etcd:v3.7.1

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

```console
$ etcdctl member list -w table
┌──────────────────┬─────────┬─────────┬───────────────────────┬───────────────────────┬────────────┐
│ ID │ STATUS │ NAME │ PEER ADDRS │ CLIENT ADDRS │ IS LEARNER │
├──────────────────┼─────────┼─────────┼───────────────────────┼───────────────────────┼────────────┤
│ 8e9e05c52164694d │ started │ default │ http://localhost:2380 │ http://localhost:2379 │ false │
└──────────────────┴─────────┴─────────┴───────────────────────┴───────────────────────┴────────────┘

$ etcdctl --endpoints= endpoint status -w table
┌───────────────────────┬──────────────────┬─────────┬─────────────────┬─────────┬────────┬───────────────────────┬────────┬───────────┬────────────┬───────────┬────────────┬────────────────────┬────────┬──────────────────────────┬───────────────────┐
│ ENDPOINT │ ID │ VERSION │ STORAGE VERSION │ DB SIZE │ IN USE │ PERCENTAGE NOT IN USE │ QUOTA │ IS LEADER │ IS LEARNER │ RAFT TERM │ RAFT INDEX │ RAFT APPLIED INDEX │ ERRORS │ DOWNGRADE TARGET VERSION │ DOWNGRADE ENABLED │
├───────────────────────┼──────────────────┼─────────┼─────────────────┼─────────┼────────┼───────────────────────┼────────┼───────────┼────────────┼───────────┼────────────┼────────────────────┼────────┼──────────────────────────┼───────────────────┤
│ http://localhost:2379 │ 8e9e05c52164694d │ 3.7.1 │ 3.7.0 │ 20 kB │ 16 kB │ 20% │ 2.1 GB │ true │ false │ 2 │ 4 │ 4 │ │ │ false │
└───────────────────────┴──────────────────┴─────────┴─────────────────┴─────────┴────────┴───────────────────────┴────────┴───────────┴────────────┴───────────┴────────────┴────────────────────┴────────┴──────────────────────────┴───────────────────┘
```

### Relevant log output

```Shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.