Skip to content

Commit

Permalink
compact: introduce flag --block-viewer.global.sync-block-interval
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chrischdi committed Jun 19, 2020
1 parent 6c513e5 commit b38c6cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -35,6 +35,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel

- [#2671](https://github.com/thanos-io/thanos/pull/2671) Tools: bucket replicate now allows passing repeated `--compaction` and `--resolution` flags.
- [#2657](https://github.com/thanos-io/thanos/pull/2657) Querier: Now, has the ability to perform concurrent select request per query.
- [#2752](https://github.com/thanos-io/thanos/pull/2752) Compact: add flag to configure metadata sync interval for the bucket ui

## [v0.13.0](https://github.com/thanos-io/thanos/releases) - IN PROGRESS

Expand Down
5 changes: 4 additions & 1 deletion cmd/thanos/compact.go
Expand Up @@ -400,7 +400,7 @@ func runCompact(
iterCancel()

// For /global state make sure to fetch periodically.
return runutil.Repeat(time.Minute, ctx.Done(), func() error {
return runutil.Repeat(conf.blockViewerSyncBlockInterval, ctx.Done(), func() error {
return runutil.RetryWithLog(logger, time.Minute, ctx.Done(), func() error {
iterCtx, iterCancel := context.WithTimeout(ctx, conf.waitInterval)
defer iterCancel()
Expand Down Expand Up @@ -435,6 +435,7 @@ type compactConfig struct {
waitInterval time.Duration
disableDownsampling bool
blockSyncConcurrency int
blockViewerSyncBlockInterval time.Duration
compactionConcurrency int
deleteDelay model.Duration
dedupReplicaLabels []string
Expand Down Expand Up @@ -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)

cmd.Flag("compact.concurrency", "Number of goroutines to use when compacting groups.").
Default("1").IntVar(&cc.compactionConcurrency)
Expand Down
4 changes: 4 additions & 0 deletions docs/components/compact.md
Expand Up @@ -141,6 +141,10 @@ Flags:
--block-sync-concurrency=20
Number of goroutines to use when syncing block
metadata from object storage.
--block-viewer.global.sync-block-interval=1m
Repeat interval for syncing the blocks between
local and remote view for /global Block Viewer
UI.
--compact.concurrency=1 Number of goroutines to use when compacting
groups.
--delete-delay=48h Time before a block marked for deletion is
Expand Down

0 comments on commit b38c6cd

Please sign in to comment.