Skip to content

If ingester.max-transfer-retries is set to 0, hand-over attempts are … #1777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [CHANGE] The frontend component has been refactored to be easier to re-use. When upgrading the frontend, cache entries will be discarded and re-created with the new protobuf schema. #1734
* [CHANGE] Remove direct DB/API access from the ruler
* [CHANGE] Removed `Delta` encoding. Any old chunks with `Delta` encoding cannot be read anymore. If `ingester.chunk-encoding` is set to `Delta` the ingester will fail to start. #1706
* [CHANGE] Setting `-ingester.max-transfer-retries` to 0 now disables hand-over when ingester is shutting down. Previously, zero meant infinite number of attempts. #1771
* [FEATURE] Global limit on the max series per user and metric #1760
* `-ingester.max-global-series-per-user`
* `-ingester.max-global-series-per-metric`
Expand Down
4 changes: 2 additions & 2 deletions docs/arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ It also talks to a KVStore and has it's own copies of the same flags used by the

How long to wait in PENDING state during the [hand-over process](ingester-handover.md). (default 0s)

- `-ingester.ingester.max-transfer-retries`
- `-ingester.max-transfer-retries`

How many times a LEAVING ingester tries to find a PENDING ingester during the [hand-over process](ingester-handover.md). Each attempt takes a second or so. (default 10)
How many times a LEAVING ingester tries to find a PENDING ingester during the [hand-over process](ingester-handover.md). Each attempt takes a second or so. Negative value or zero disables hand-over process completely. (default 10)

- `-ingester.normalise-tokens`

Expand Down
4 changes: 2 additions & 2 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func newIngesterMetrics(r prometheus.Registerer) *ingesterMetrics {
type Config struct {
LifecyclerConfig ring.LifecyclerConfig `yaml:"lifecycler,omitempty"`

// Config for transferring chunks.
// Config for transferring chunks. Zero or negative = no retries.
MaxTransferRetries int `yaml:"max_transfer_retries,omitempty"`

// Config for chunk flushing.
Expand Down Expand Up @@ -134,7 +134,7 @@ type Config struct {
func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
cfg.LifecyclerConfig.RegisterFlags(f)

f.IntVar(&cfg.MaxTransferRetries, "ingester.max-transfer-retries", 10, "Number of times to try and transfer chunks before falling back to flushing.")
f.IntVar(&cfg.MaxTransferRetries, "ingester.max-transfer-retries", 10, "Number of times to try and transfer chunks before falling back to flushing. Negative value or zero disables hand-over.")
f.DurationVar(&cfg.FlushCheckPeriod, "ingester.flush-period", 1*time.Minute, "Period with which to attempt to flush chunks.")
f.DurationVar(&cfg.RetainPeriod, "ingester.retain-period", 5*time.Minute, "Period chunks will remain in memory after flushing.")
f.DurationVar(&cfg.FlushOpTimeout, "ingester.flush-op-timeout", 1*time.Minute, "Timeout for individual flush operations.")
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func defaultIngesterTestConfig() Config {
cfg.LifecyclerConfig.Addr = "localhost"
cfg.LifecyclerConfig.ID = "localhost"
cfg.LifecyclerConfig.FinalSleep = 0
cfg.MaxTransferRetries = -1
cfg.MaxTransferRetries = 0
return cfg
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func fromWireChunks(wireChunks []client.Chunk) ([]*desc, error) {
// TransferOut finds an ingester in PENDING state and transfers our chunks to it.
// Called as part of the ingester shutdown process.
func (i *Ingester) TransferOut(ctx context.Context) error {
if i.cfg.MaxTransferRetries < 0 {
if i.cfg.MaxTransferRetries <= 0 {
return fmt.Errorf("transfers disabled")
}
backoff := util.NewBackoff(ctx, util.BackoffConfig{
Expand Down