Skip to content

Commit

Permalink
Removed Querier duplicate labels checks & made sure store will be not…
Browse files Browse the repository at this point in the history
… blocked for older Queriers. (#1636)

Changes:
* Cleaned up the code a bit.
* Ensured proper locks.
* thanos_store_nodes_grpc_connections is not per store type and external labels. thanos_store_node_info is marked as deprecated.
* Added (optional, but enabled by default) compatibility label to store GW Info method with flag to disable it. Store only adds it if there is any labelset to advertise.
* Disabled any strict deduplication in external labels detection; just warning!
* More tests; compatibility tests for query pre 0.8.0 and new store GW.
* Remove compatibility label if spotted.

Fixes #1632

Signed-off-by: Bartek Plotka <[email protected]>
  • Loading branch information
bwplotka authored Oct 14, 2019
1 parent 7b95079 commit 8d24d8a
Show file tree
Hide file tree
Showing 9 changed files with 1,409 additions and 390 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ We use *breaking* word for marking changes that are not backward compatible (rel

## Unreleased

### Fixed

- [#1632](https://github.com/thanos-io/thanos/issues/1632) Removes the duplicated external labels detection on Thanos Querier; warning only; Made Store Gateway compatible with older Querier versions.
NOTE: `thanos_store_nodes_grpc_connections` metric is now per `external_labels` and `store_type`. It is a recommended metric for Querier storeAPIs. `thanos_store_node_info` is marked as obsolete and will be removed in next release.
NOTE2: Store Gateway is not advertising artificial: `"@thanos_compatibility_store_type=store"` label. This is to have current Store Gateway compatible with Querier pre v0.8.0.
This label can be disabled by hidden `debug.advertise-compatibility-label=false` flag on Store Gateway.

## [v0.8.0](https://github.com/thanos-io/thanos/releases/tag/v0.8.0) - 2019.10.10

Lot's of improvements this release! Noteworthy items:
Expand Down Expand Up @@ -51,7 +58,7 @@ Selecting blocks to serve depends on the result of block labels relabeling.
- [#1362](https://github.com/thanos-io/thanos/pull/1362) `query.replica-label` configuration can be provided more than
once for multiple deduplication labels like: `--query.replica-label=prometheus_replica --query.replica-label=service`.
- [#1581](https://github.com/thanos-io/thanos/pull/1581) Thanos Store now can use smaller buffer sizes for Bytes pool; reducing memory for some requests.
- [#1622](https://github.com/thanos-io/thanos/pull/1622) & [#1590](https://github.com/thanos-io/thanos/pull/1590) Updated to Go 1.13.1
- [#1622](https://github.com/thanos-io/thanos/pull/1622) & [#1590](https://github.com/thanos-io/thanos/pull/1590) Upgraded to Go 1.13.1
- [#1498](https://github.com/thanos-io/thanos/pull/1498) Thanos Receive change flag `labels` to `label` to be consistent with other commands.

### Fixed
Expand Down
6 changes: 6 additions & 0 deletions cmd/thanos/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func registerStore(m map[string]setupFunc, app *kingpin.Application) {
maxTime := model.TimeOrDuration(cmd.Flag("max-time", "End of time range limit to serve. Thanos Store will serve only blocks, which happened eariler than this value. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y.").
Default("9999-12-31T23:59:59Z"))

advertiseCompatibilityLabel := cmd.Flag("debug.advertise-compatibility-label", "If true, Store Gateway in addition to other labels, will advertise special \"@thanos_compatibility_store_type=store\" label set. This makes store Gateway compatible with Querier before 0.8.0").
Hidden().Default("true").Bool()

selectorRelabelConf := regSelectorRelabelFlags(cmd)

m[component.Store.String()] = func(g *run.Group, logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, debugLogging bool) error {
Expand Down Expand Up @@ -92,6 +95,7 @@ func registerStore(m map[string]setupFunc, app *kingpin.Application) {
MaxTime: *maxTime,
},
selectorRelabelConf,
*advertiseCompatibilityLabel,
)
}
}
Expand Down Expand Up @@ -119,6 +123,7 @@ func runStore(
blockSyncConcurrency int,
filterConf *store.FilterConfig,
selectorRelabelConf *extflag.PathOrContent,
advertiseCompatibilityLabel bool,
) error {
statusProber := prober.NewProber(component, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg))

Expand Down Expand Up @@ -173,6 +178,7 @@ func runStore(
blockSyncConcurrency,
filterConf,
relabelConfig,
advertiseCompatibilityLabel,
)
if err != nil {
return errors.Wrap(err, "create object storage store")
Expand Down
Loading

0 comments on commit 8d24d8a

Please sign in to comment.