-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
compact: introduce flag --wait-sync-block-duration #2752
compact: introduce flag --wait-sync-block-duration #2752
Conversation
c1b62fb
to
d681877
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, this is important fix I agree.
BTW what do you think of something else - some logic of 0
were you disable syncing totally.
- It would be only refreshed when refresh bucket UI page, WDYT?
In the mean time we can merge this 👍 one suggestion only.
Thanks! ❤️
cmd/thanos/compact.go
Outdated
@@ -475,6 +476,8 @@ func (cc *compactConfig) registerFlag(cmd *kingpin.CmdClause) *compactConfig { | |||
Short('w').BoolVar(&cc.wait) | |||
cmd.Flag("wait-interval", "Wait interval between consecutive compaction runs and bucket refreshes. Only works when --wait flag specified."). | |||
Default("5m").DurationVar(&cc.waitInterval) | |||
cmd.Flag("wait-sync-block-interval", "Repeat interval for syncing the blocks between local and remote view."). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good but I think we have to name it better to show it's related to the UI.
What about something like:
cmd.Flag("wait-sync-block-interval", "Repeat interval for syncing the blocks between local and remote view."). | |
cmd.Flag("block-viewer.global.sync-block-interval", "Repeat interval for syncing the blocks between local and remote view for /global Block Viewer UI."). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will fix that and also fix the changelog conflict :-) (will have to rebuild the docs anyway)
Sounds also reasonable to me. Maybe it would make more sense to allow using the cached index for the bucket UI? |
Yes, it's must have - in separate PR (: BTW @pstibrany do we have to cache for Cortex compactor? I guess yes? |
In Cortex we don't use cache for compactor. Our default interval for running compactor is one hour, so it scans bucket only once per hour. While we could use cache that is shared by queriers/store-gateways, but since scans are so infrequent, we decided that compactor having the correct picture of the world is more important. |
d681877
to
b38c6cd
Compare
I'm not sure it's safe. The compactor should always have the real state of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (modulo a nit)
The compactor yes but the bucket web UI may not need to have that?! |
The UI can use as far as you accept to not see the latest state of the bucket. I personally would prefer to have the UI to always reflect the latest state, but I'm open to discuss it. |
1a26214
to
bc9a7a0
Compare
Thanos compact currently does metadata sync every minute if `--wait` is active. Thanos store has a equivalent flag named `sync-block-duration`. This commit introduces `--block-viewer.global.sync-block-interval` to be able to configure the interval via a flag. Signed-off-by: Schlotter, Christian <christi.schlotter@gmail.com>
bc9a7a0
to
1011c4b
Compare
Rebased to fix CHANGELOG.md conflict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks! 👍
@@ -482,6 +483,8 @@ func (cc *compactConfig) registerFlag(cmd *kingpin.CmdClause) *compactConfig { | |||
|
|||
cmd.Flag("block-sync-concurrency", "Number of goroutines to use when syncing block metadata from object storage."). | |||
Default("20").IntVar(&cc.blockSyncConcurrency) | |||
cmd.Flag("block-viewer.global.sync-block-interval", "Repeat interval for syncing the blocks between local and remote view for /global Block Viewer UI."). | |||
Default("1m").DurationVar(&cc.blockViewerSyncBlockInterval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is causing problems, why not reducing this to a minimum? 🤔 Anyway we can think in later PRs!
* upstream/release-0.14: (46 commits) Cut release v0.14.0-rc.1 (thanos-io#2853) Query: correctly marshal errors to JSON and ignore if nil (thanos-io#2848) ci: Manually download promu in crossbuild stage (thanos-io#2828) Cut release v0.14.0-rc.0 (thanos-io#2826) Soft cut changelog on master to indicate v0.14.0 being in progress (thanos-io#2824) Update ThanosReceiveNoUpload to select sum == 0 (thanos-io#2819) receive: Added more observability, fixed leaktest, to actually check leaks ): (thanos-io#2817) Query: always return a string in the `lastError` field (thanos-io#2809) Added missing CHANGELOG entry for PR 2613 (thanos-io#2820) receive: Fixed small options race; Removed unused StartTime feature. (thanos-io#2816) go.mod: Bump Prometheus to current latest (thanos-io#2814) Implement CLI Flags page in React UI (thanos-io#2796) Improve ThanosReceiveNoUpload to only alert on current instances store: Preallocate output buffer when encoding postings. (thanos-io#2812) compact: introduce flag --block-viewer.global.sync-block-interval (thanos-io#2752) docs: compact: add blurb about how retention policy works (thanos-io#2808) Reduced memory allocations in readIndexRange() (thanos-io#2807) ui: Add Stores page to React UI (thanos-io#2754) Added Kemal to Maintainer Role; Kemal is volounteering to be next release shephard (thanos-io#2804) proposal: Add scalable rule storage proposal (thanos-io#2661) ...
Thanos compact currently does metadata sync every minute if
--wait
isactive. Thanos store has a equivalent flag named
sync-block-duration
.This commit introduces
--wait-sync-block-duration
to be able toconfigure the interval via a flag.
Resolves #2642
Signed-off-by: Schlotter, Christian christi.schlotter@gmail.com
Changes
--wait-sync-block-duration
to compact commandVerification
Run it in production