Skip to content

Commit ec14e21

Browse files
authored
Jsonnet: allow to selectively configure ZPDB (#13813)
#### What this PR does In this PR I'm proposing a jsonnet change to allow to selectively configure ZPDB on a per-component basis: remove `multi_zone_zpdb_enabled` and replace it with `multi_zone_ingester_zpdb_enabled` and `multi_zone_store_gateway_zpdb_enabled`. #### Which issue(s) this PR fixes or relates to N/A #### Checklist - [ ] Tests updated. - [ ] Documentation added. - [x] `CHANGELOG.md` updated - the order of entries should be `[CHANGE]`, `[FEATURE]`, `[ENHANCEMENT]`, `[BUGFIX]`. If changelog entry is not needed, please add the `changelog-not-needed` label to the PR. - [ ] [`about-versioning.md`](https://github.com/grafana/mimir/blob/main/docs/sources/mimir/configure/about-versioning.md) updated with experimental features. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Make ZPDB selectable per component by replacing the global flag with `multi_zone_ingester_zpdb_enabled` and `multi_zone_store_gateway_zpdb_enabled` and updating PDB logic accordingly. > > - **Jsonnet (multi-zone)**: > - Introduce per-component ZPDB toggles: `multi_zone_ingester_zpdb_enabled` and `multi_zone_store_gateway_zpdb_enabled` (default to their component enablement). > - Replace uses of global `multi_zone_zpdb_enabled`; update assertions to check `rollout_operator_webhooks_enabled` per component. > - Update rollout PDB creation to conditionally use `$.newZPDB(...)` based on the new per-component flags. > - Remove obsolete assertion and config related to the global ZPDB flag in `operations/mimir/multi-zone-common.libsonnet`. > - **Docs**: > - Update `CHANGELOG.md` with the config change and rationale. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 16e0390. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Signed-off-by: Marco Pracucci <[email protected]>
1 parent 686a666 commit ec14e21

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
* [CHANGE] Store-gateway: The store-gateway disk class now honors the one configured via `$._config.store_gateway_data_disk_class` and doesn't replace `fast` with `fast-dont-retain`. #13152
170170
* [CHANGE] Rollout-operator: Vendor jsonnet from rollout-operator repository. #13245 #13317 #13793 #13799
171171
* [CHANGE] Ruler: Set default memory ballast to 1GiB to reduce GC pressure during startup. #13376
172+
* [CHANGE] Zone pod disruption budget: Remove `multi_zone_zpdb_enabled` and replace it with `multi_zone_ingester_zpdb_enabled` and `multi_zone_store_gateway_zpdb_enabled` to allow to selectively enable the zone pod disruption budget on a per-component basis. #13813
172173
* [FEATURE] Add multi-zone support for read path components (memcached, querier, query-frontend, query-scheduler, ruler, and ruler remote evaluation stack). Add multi-AZ support for ingester and store-gateway multi-zone deployments. Add memberlist-bridge support for zone-aware memberlist routing. #13559 #13628 #13636
173174
* [ENHANCEMENT] Ruler querier and query-frontend: Add support for newly-introduced querier ring, which is used when performing query planning in query-frontends and distributing portions of the plan to queriers for execution. #13017
174175
* [ENHANCEMENT] Ingester: Increase `$._config.ingester_tsdb_head_early_compaction_min_in_memory_series` default when Mimir is running with the ingest storage architecture. #13450

operations/mimir/multi-zone-common.libsonnet

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ local jsonpath = import 'github.com/jsonnet-libs/xtd/jsonpath.libsonnet';
22

33
{
44
_config+: {
5-
// Use a zone aware pod disruption budget for ingester and/or store-gateways
6-
multi_zone_zpdb_enabled: $._config.multi_zone_ingester_enabled || $._config.multi_zone_store_gateway_enabled,
7-
85
// Ordered list of availability zones where multi-zone components should be deployed to.
96
// Mimir zone-a deployments are scheduled to the first AZ in the list, zone-b deployment to the second AZ,
107
// and zone-c deployments to the third AZ. Maximum 3 AZs are supported.
@@ -36,7 +33,6 @@ local jsonpath = import 'github.com/jsonnet-libs/xtd/jsonpath.libsonnet';
3633
],
3734
},
3835

39-
assert !$._config.multi_zone_zpdb_enabled || $._config.rollout_operator_webhooks_enabled : 'zpdb configuration requires rollout_operator_webhooks_enabled=true',
4036
assert std.length($._config.multi_zone_availability_zones) <= 3 : 'Mimir jsonnet supports a maximum of 3 availability zones',
4137

4238
//

operations/mimir/multi-zone-ingester.libsonnet

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
multi_zone_ingester_replication_read_path_enabled: true,
77
multi_zone_ingester_replicas: 0,
88
multi_zone_ingester_max_unavailable: 50,
9+
multi_zone_ingester_zpdb_enabled: $._config.multi_zone_ingester_enabled,
910

1011
// this can be either a number or a percenage. ie 1 or 50%
1112
multi_zone_ingester_zpdb_max_unavailable: if $._config.ingest_storage_enabled then 1 else std.toString($._config.multi_zone_ingester_max_unavailable),
@@ -32,6 +33,7 @@
3233
local isZoneCEnabled = isMultiAZEnabled && std.length($._config.multi_zone_availability_zones) >= 3,
3334

3435
assert !isMultiAZEnabled || $._config.multi_zone_ingester_enabled : 'ingester multi-AZ deployment requires ingester multi-zone to be enabled',
36+
assert !$._config.multi_zone_ingester_zpdb_enabled || $._config.rollout_operator_webhooks_enabled : 'zpdb configuration requires rollout_operator_webhooks_enabled=true',
3537

3638
//
3739
// Zone-aware replication.
@@ -142,7 +144,7 @@
142144

143145
ingester_rollout_pdb: if !$._config.multi_zone_ingester_enabled then null else
144146
(
145-
if $._config.multi_zone_zpdb_enabled then
147+
if $._config.multi_zone_ingester_zpdb_enabled then
146148
$.newZPDB('ingester-rollout', 'ingester', $._config.multi_zone_ingester_zpdb_max_unavailable, $._config.multi_zone_ingester_zpdb_partition_regex, $._config.multi_zone_ingester_zpdb_partition_group)
147149
else
148150
podDisruptionBudget.new('ingester-rollout') +

operations/mimir/multi-zone-store-gateway.libsonnet

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
multi_zone_store_gateway_read_path_enabled: $._config.multi_zone_store_gateway_enabled,
55
multi_zone_store_gateway_migration_enabled: false,
66
multi_zone_store_gateway_replicas: 0,
7+
multi_zone_store_gateway_zpdb_enabled: $._config.multi_zone_store_gateway_enabled,
8+
79
// When store-gateway lazy loading is disabled, store-gateway may take a long time to startup.
810
// To speed up rollouts, we increase the max unavailable to rollout all store-gateways in a zone in a single batch.
911
multi_zone_store_gateway_max_unavailable: if $._config.store_gateway_lazy_loading_enabled then 50 else 1000,
@@ -28,6 +30,7 @@
2830

2931
assert !isMultiAZEnabled || $._config.multi_zone_store_gateway_enabled : 'store-gateway multi-AZ deployment requires store-gateway multi-zone to be enabled',
3032
assert !isMultiAZEnabled || $._config.multi_zone_memcached_enabled : 'store-gateway multi-AZ deployment requires memcached multi-zone to be enabled',
33+
assert !$._config.multi_zone_store_gateway_zpdb_enabled || $._config.rollout_operator_webhooks_enabled : 'zpdb configuration requires rollout_operator_webhooks_enabled=true',
3134

3235
//
3336
// Zone-aware replication.
@@ -169,7 +172,7 @@
169172
store_gateway_rollout_pdb:
170173
if !$._config.multi_zone_store_gateway_enabled then null else
171174
(
172-
if $._config.multi_zone_zpdb_enabled then
175+
if $._config.multi_zone_store_gateway_zpdb_enabled then
173176
$.newZPDB('store-gateway-rollout', 'store-gateway', $._config.multi_zone_store_gateway_zpdb_max_unavailable)
174177
else
175178
podDisruptionBudget.new('store-gateway-rollout') +

0 commit comments

Comments
 (0)