Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 9627ecd

Browse files
authored
Merge pull request #236 from grafana/add-option-to-not-unregister-ingesters-on-shutdown
Add option to configure unregister ingesters on shutdown
2 parents c40d2bb + b237a05 commit 9627ecd

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## master / unreleased
44

5+
* [ENHANCEMENT] Added `unregister_ingesters_on_shutdown` config option to disable unregistering ingesters on shutdown (default is enabled). #213
6+
57
## 1.6.0 / 2021-01-05
68

79
* [CHANGE] Add default present for ruler limits on all 'user' types. #221, #222

cortex/config.libsonnet

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
aws_region: error 'must specify AWS region',
1414
s3_bucket_name: error 'must specify S3 bucket name',
1515

16+
// If false, ingesters are not unregistered on shutdown and left in the ring with
17+
// the LEAVING state. Setting to false prevents series resharding during ingesters rollouts,
18+
// but requires to:
19+
// 1. Either manually forget ingesters on scale down or invoke the /shutdown endpoint
20+
// 2. Ensure ingester ID is preserved during rollouts
21+
unregister_ingesters_on_shutdown: true,
22+
1623
// schema is used to generate the storage schema yaml file used by
1724
// the Cortex chunks storage:
1825
// - More information: https://github.com/cortexproject/cortex/pull/1072

cortex/distributor.libsonnet

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
// The ingestion rate global limit requires the distributors to form a ring.
3737
'distributor.ring.consul.hostname': 'consul.%s.svc.cluster.local:8500' % $._config.namespace,
3838
'distributor.ring.prefix': '',
39-
},
39+
40+
// Do not extend the replication set on unhealthy (or LEAVING) ingester when "unregister on shutdown"
41+
// is set to false.
42+
'distributor.extend-writes': $._config.unregister_ingesters_on_shutdown,
43+
),
4044

4145
distributor_ports:: $.util.defaultPorts,
4246

cortex/ingester.libsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'ingester.max-transfer-retries': 60, // Each retry is backed off by 5s, so 5mins for new ingester to come up.
1616
'ingester.heartbeat-period': '15s',
1717
'ingester.max-stale-chunk-idle': '5m',
18+
'ingester.unregister-on-shutdown': $._config.unregister_ingesters_on_shutdown,
1819

1920
// Chunk building/flushing config.
2021
'ingester.chunk-encoding': 3, // Bigchunk encoding

0 commit comments

Comments
 (0)