TSDB head compactor concurrency#2172
TSDB head compactor concurrency#2172pracucci merged 21 commits intocortexproject:masterfrom pstibrany:tsdb-head-compactor-concurrency
Conversation
gouthamve
left a comment
There was a problem hiding this comment.
Mostly LGTM, will 👍 after comments are addressed :)
docs/operations/blocks-storage.md
Outdated
There was a problem hiding this comment.
Hrm, this should be 5m and the tests should fail. Can you check why its not failing?
There was a problem hiding this comment.
I have edited this file manually. Somehow it isn't covered by Marco's tool, but haven't looked into more detail why yet. I'll fix the default.
There was a problem hiding this comment.
I think the reason is simply because block-storage is a separate file, while doc tool only generates config-file-reference.md. @pracucci surely knows better, I'm just guessing based on 5min looking around.
|
Fixes #2174 |
pracucci
left a comment
There was a problem hiding this comment.
Good job @pstibrany and thanks for taking care of this! I left few comments, everything else LGTM 🎉
pkg/ingester/ingester_v2.go
Outdated
There was a problem hiding this comment.
Why is it possible to disable compactions? We should never allow it. Even if you run without shipper you definitely wants compactions otherwise your memory will soon explode.
I would suggest:
- Add a config validation to ensure that
HeadCompactionConcurrency > 0 - Always run
compactionLoop()
What's your take?
There was a problem hiding this comment.
I left an option to disable it when running tests. But now I think it doesn't make sense even in that scenario. I'll modify it.
pkg/storage/tsdb/config.go
Outdated
There was a problem hiding this comment.
5m looks a bit unfrequent to me. This is a very inexpensive operation and I would suggest to run it more frequently: 30s or 1m.
There was a problem hiding this comment.
Do we even need to make it configurable? I'd just hardcode 1m into the code.
There was a problem hiding this comment.
I thought about hardcoding to 1m as well, and that was my initial comment. I then changed my mind because I think being able to configure it could help future integration tests (ie. compact every 5s to have integration tests running faster). What's your take?
P.S. I'm talking about integration tests cause I would like to add at least 1 integration test testing the compaction and shipping soon.
There was a problem hiding this comment.
We need a secret option then ;-) I'd suggest adding a check to avoid setting it too high (> 5 mins).
There was a problem hiding this comment.
We need a secret option then ;-)
We can have a secret YAML config option with doc:"hidden" but I'm not sure it's possible to have an hidden CLI flag (I haven't investigated).
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
This reverts commit ac372e9f065f00e909f67d7c3b3557e2974f311c. Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
This reverts commit 9adb4cb9b4273ac189a3bb0478090966a0db67ec. Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
To avoid confusion with compactor, which also has "compaction_interval" config field. Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
They are now updated in Cortex code, when we call compaction. Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
- decrease default to 1 min - compaction cannot be disabled - compaction interval must be greater than 0, and <= 5 mins Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
pracucci
left a comment
There was a problem hiding this comment.
LGTM, with a nit. Thanks!
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
What this PR does: This PR makes TSDB head compaction interval and concurrency configurable (defaults to 2h). Shipping now happens right after compaction, and previous options to control shipping interval and concurrency have been removed. Shipping can still be disabled.
Which issue(s) this PR fixes:
Fixes #2003
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]