From 6210c6cab217c97c6ae8137f07507fa4ae202b8c Mon Sep 17 00:00:00 2001 From: Kaviraj Date: Wed, 15 Sep 2021 13:47:13 +0200 Subject: [PATCH 1/2] Fix `compactor_blocks_retention_period` type in `extra_small_user` The actual type of `compactor_blocks_retention_period` is `model.Duration`. Which comes from prometheus `common` package. The problem is that `model.Duration` have custom JSON unmarshal which treat the incoming value as string. https://github.com/prometheus/common/blob/main/model/time.go#L276 So setting it as integer, won't work when unmarshalling with JSON. NOTE: This won't be an issue for YamlUnmarshal, as it always treating it as string (even though you put it as integer) https://github.com/prometheus/common/blob/main/model/time.go#L307 --- cortex/config.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cortex/config.libsonnet b/cortex/config.libsonnet index 6369513..f52b38d 100644 --- a/cortex/config.libsonnet +++ b/cortex/config.libsonnet @@ -358,7 +358,7 @@ ruler_max_rule_groups_per_tenant: 20, // No retention for now. - compactor_blocks_retention_period: 0, + compactor_blocks_retention_period: '0', }, medium_small_user:: { From def08889f7fee5b30e40b0318a43f325d7a389ec Mon Sep 17 00:00:00 2001 From: Kaviraj Date: Wed, 15 Sep 2021 13:59:05 +0200 Subject: [PATCH 2/2] update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f9f46..5e728aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ * [BUGFIX] Fixed rollout progress dashboard to include query-scheduler too. #376 * [BUGFIX] Fixed `-distributor.extend-writes` setting on ruler when `unregister_ingesters_on_shutdown` is disabled. #369 * [BUGFIX] Upstream recording rule `node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate` renamed. #379 +* [BUGFIX] Treat `compactor_blocks_retention_period` type as string rather than int.#395 ## 1.9.0 / 2021-05-18