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

default value of auto-compaction in 3.2.x #9456

Closed
shsjshentao opened this issue Mar 19, 2018 · 8 comments
Closed

default value of auto-compaction in 3.2.x #9456

shsjshentao opened this issue Mar 19, 2018 · 8 comments

Comments

@shsjshentao
Copy link
Contributor

In document, i find the default value of auto-compaction is 0. It seems to mean no compact.
But in fact, i find etcd will compact every 5 minutes if i do not set this flag.
Is it a bug in 3.2?
Is it related to #8098?

@hexfusion
Copy link
Contributor

In document, i find the default value of auto-compaction is 0.

HI @shsjshentao which document are you referring to?

@gyuho
Copy link
Contributor

gyuho commented Mar 19, 2018

etcd will compact every 5 minutes

How do you know? Do you have server logs?

@yudai
Copy link
Contributor

yudai commented Mar 19, 2018

I think it's due to #9443.
Since last is not updated, every iteration of timeout triggers auto compaction.

@hexfusion
Copy link
Contributor

hexfusion commented Mar 19, 2018

Not to hijack the issue but I do see this constant. How does this fit into the picture?

https://github.com/coreos/etcd/blob/5b9741e804a44990f67b5eeab686b7141a801346/compactor/compactor.go#L32

I guess every 5 mins would cause timeout/compact @yudai ?

@yudai
Copy link
Contributor

yudai commented Mar 19, 2018

The value @hexfusion pointed out is used here to set timeout in the loop:

https://github.com/coreos/etcd/blob/5b9741e804a44990f67b5eeab686b7141a801346/compactor/periodic.go#L72

and as mentioned in #9443, last is not updated at all, so this condition is pass through;

https://github.com/coreos/etcd/blob/5b9741e804a44990f67b5eeab686b7141a801346/compactor/periodic.go#L80

Eventually, every 5 minutes, auto compaction happens without checking the last execution time.

@hexfusion
Copy link
Contributor

@shsjshentao after @yudai explanation I feel this is a duplicate of #9443. Please track this issue for updates.

@gyuho
Copy link
Contributor

gyuho commented Mar 20, 2018

@shsjshentao If you set auto compaction 0, compactor wouldn't even run. What's the server log?

@yudai
Copy link
Contributor

yudai commented Mar 20, 2018

Oh that's true. I think I jumped into a wrong way. Sorry for that.
The revision based compactor referenced by #8098 is not included in 3.2.x. So it should be not related.

What I came up with 5 minutes around compactor is checkCompactionInterval . However, I double checked the code and 3.2.x doesn't have the same issue referenced by #9443. Moreover, as @gyuho mentioned, if you do not provide a value to the flag, the compactor itself should not run at all.

https://github.com/coreos/etcd/blob/c8cfdb3b558f758367b8f0c4566fce88b56c9aec/etcdserver/server.go#L489-L495

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

No branches or pull requests

4 participants