-
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
Question: Need a cronjob to trigger defrag if already got auto-compaction configured? #8496
Comments
It's fine to run defrag every hour but while etcd is defragmenting it can't serve keys.
It is only triggered on an RPC request. An in-progress defragment operation is not resumed on member restart.
It only deletes keys from the database and makes that space available to the db internally. It does not free file system space like defragmenting, which is what the database size quota checks. This is explained in the maintenance documentation at https://github.com/coreos/etcd/blob/master/Documentation/op-guide/maintenance.md#defragmentation.
No. etcd does compaction in the background by default, the physical flag makes the RPC wait until the compaction is entirely written to the db. The behavior is explained in the RPC documentation at https://github.com/coreos/etcd/blob/master/Documentation/dev-guide/api_reference_v3.md#message-compactionrequest-etcdserveretcdserverpbrpcproto. |
Thanks @heyitsanthony
I presumed some more data could be inserted after the compaction if compaction could make space for db internally, but seems like not the case. Did I miss some operation? (I have tried both compact with & without |
The quota is based on the database size on disk; compacting the db will not change that. It has to be defragmented to reclaim the space after a compaction. You can avoid hitting the quota by periodically compacting and defragmenting based on the cluster workload. |
Questions answered; closing. |
I am using etcd v3.2.2 for some time, and run into
Error: etcdserver: mvcc: database space exceeded
every day / other day, with auto-compaction set to 24h. I have tried:I know I could try shorten the compaction gap to 1h, but there are some questions to ask firstly:
btw, any update on this issue 'Adding guidance of configuring compaction related parameters #8018'
The text was updated successfully, but these errors were encountered: