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

Dedup data is not cleaned up in Consul KV storage #1158

Closed
bofm opened this issue Dec 6, 2018 · 0 comments · Fixed by #1168
Closed

Dedup data is not cleaned up in Consul KV storage #1158

bofm opened this issue Dec 6, 2018 · 0 comments · Fixed by #1168
Labels
Milestone

Comments

@bofm
Copy link
Contributor

bofm commented Dec 6, 2018

Consul Template version

v0.19.5 and master (fd266d9)

Expected behavior

Consul kv dedup storage should be maintained by Consul-Template. Stale /consul-template/dedup/<md5>/{data,lock} keys should be cleaned up automatically.

Actual behavior

Many unused old dedup data and lock keys are left in the Consul kv dedup storage.

What's strange is that /lock keys are not cleaned up by Consul's Session TTL mechanism when consul-template instances are shut down gracefully. But the /lock keys are cleaned up when consul-template instances are killed.
The /data keys are not cleaned up in any case.

Steps to reproduce

A script to run the testcase and it's output:

https://gist.github.com/bofm/677de0b543a071bab68bf77d070d6c3a

Run it in an empty directory on a host with consul and consul-template installed. It might be required to run several times to reproduce the problem.

Questions

Does consul-template really need two keys per template hash (both /data and /lock) for deduplication? I believe one key would be sufficient. Consul-template could acquire a session lock on /data key. To determine if the template is already rendered a custom flag on the key could be used.

bofm pushed a commit to bofm/consul-template that referenced this issue Jan 21, 2019
bofm added a commit to bofm/consul-template that referenced this issue Feb 20, 2019
bofm added a commit to bofm/consul-template that referenced this issue Feb 20, 2019
@eikenb eikenb added the bug label Jun 14, 2019
@eikenb eikenb added this to the v0.20.1 milestone Jun 14, 2019
@eikenb eikenb modified the milestone: v0.20.1 Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants