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

auto-compaction-retention in logs displays nanoseconds when auto-compaction-mode set to revision #17822

Open
4 tasks done
vilitux opened this issue Apr 19, 2024 · 2 comments
Open
4 tasks done
Labels

Comments

@vilitux
Copy link

vilitux commented Apr 19, 2024

Bug report criteria

What happened?

For one of the ETCD clusters that we maintain, we've switched the auto-compaction-mode to revision based compaction. The auto-compaction-retention is set to 1000:

$ grep ^auto-compaction /etc/etcd/etcd.conf.yml 
auto-compaction-mode: "revision"
auto-compaction-retention: "1000"

When restarting, the etcd log shows the following:

{"level":"info","ts":"2024-04-18T15:27:31.278121+0200","caller":"embed/etcd.go:308","msg":"starting an etcd server","etcd-version":"3.5.12","git-sha":"e7b3bb6cc","go-version":"go1.20.13","go-os":"linux","go-arch":"amd64","max-cpu-set":2,"max-cpu-available":2,"member-initialized":true,"name":"10.10.10.10","data-dir":"/var/lib/etcd","wal-dir":"","wal-dir-dedicated":"","member-dir":"/var/lib/etcd/member","force-new-cluster":false,"heartbeat-interval":"100ms","election-timeout":"1s","initial-election-tick-advance":true,"snapshot-count":100000,"max-wals":5,"max-snapshots":5,"snapshot-catchup-entries":5000,"initial-advertise-peer-urls":["https://10.10.10.10:2380"],"listen-peer-urls":["https://10.10.10.10:2380"],"advertise-client-urls":["https://10.10.10.10:2379"],"listen-client-urls":["https://10.10.10.10:2379"],"listen-metrics-urls":["https://10.10.10.10:4001"],"cors":["*"],"host-whitelist":["*"],"initial-cluster":"","initial-cluster-state":"new","initial-cluster-token":"","quota-backend-bytes":8589934592,"max-request-bytes":1572864,"max-concurrent-streams":4294967295,"pre-vote":true,"initial-corrupt-check":false,"corrupt-check-time-interval":"0s","compact-check-time-enabled":false,"compact-check-time-interval":"1m0s","auto-compaction-mode":"revision","auto-compaction-retention":"1µs","auto-compaction-interval":"1µs","discovery-url":"","discovery-proxy":"","downgrade-check-interval":"5s"}

In this log, I would've expected to see "auto-compaction-retention":"1000", instead it shows "auto-compaction-retention":"1µs". This gives you the idea you made mistakes in the configuration.

Also, "auto-compaction-interval":"1µs" also seems wrong, since the interval is 5 minutes for revision based compaction (from what I saw, hardcoded in the source code)

What did you expect to happen?

The logs should show auto-compaction-retention set to 1000 instead of 1µs

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

Change auto-compaction-mode to revision, restart and check the logs.

Anything else we need to know?

No response

Etcd version (please run commands below)

$ etcd --version
etcd Version: 3.5.12
Git SHA: e7b3bb6cc
Go Version: go1.20.13
Go OS/Arch: linux/amd64

$ etcdctl version
etcdctl version: 3.5.12
API version: 3.5

Etcd configuration (command line flags or environment variables)

No response

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

No response

Relevant log output

No response

@wdoekes
Copy link

wdoekes commented Apr 22, 2024

(I think it would show 5µs for 5000 revisions.)

So there is this:

{
// ...
"compact-check-time-interval": "1m0s",
"auto-compaction-mode": "revision",
"auto-compaction-retention": "1µs",  // this is 1000 revisions, shown as 1000ns = 1µs
"auto-compaction-interval": "1µs",   // this seems wrong too 
"discovery-url": //...

@vilitux
Copy link
Author

vilitux commented Apr 22, 2024

Woops, you're right. During the log output the config was set to 1000. Updated to post accordingly.

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

No branches or pull requests

2 participants