Skip to content

Commit 41f2d0f

Browse files
authored
Documenting Spread Minimize token generator (#5890)
Signed-off-by: alanprot <[email protected]>
1 parent 8237bf8 commit 41f2d0f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/configuration/config-file-reference.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2833,6 +2833,11 @@ lifecycler:
28332833
# CLI flag: -ingester.num-tokens
28342834
[num_tokens: <int> | default = 128]
28352835
2836+
# EXPERIMENTAL: Algorithm used to generate new ring tokens. Supported Values:
2837+
# random,minimize-spread
2838+
# CLI flag: -ingester.tokens-generator-strategy
2839+
[tokens_generator_strategy: <string> | default = "random"]
2840+
28362841
# Period at which to heartbeat to consul. 0 = disabled.
28372842
# CLI flag: -ingester.heartbeat-period
28382843
[heartbeat_period: <duration> | default = 5s]

pkg/ring/lifecycler.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type LifecyclerConfig struct {
3333

3434
// Config for the ingester lifecycle control
3535
NumTokens int `yaml:"num_tokens"`
36-
TokensGeneratorStrategy string `yaml:"tokens_generator_strategy" doc:"hidden"`
36+
TokensGeneratorStrategy string `yaml:"tokens_generator_strategy"`
3737
HeartbeatPeriod time.Duration `yaml:"heartbeat_period"`
3838
ObservePeriod time.Duration `yaml:"observe_period"`
3939
JoinAfter time.Duration `yaml:"join_after"`
@@ -70,7 +70,7 @@ func (cfg *LifecyclerConfig) RegisterFlagsWithPrefix(prefix string, f *flag.Flag
7070
}
7171

7272
f.IntVar(&cfg.NumTokens, prefix+"num-tokens", 128, "Number of tokens for each ingester.")
73-
f.StringVar(&cfg.TokensGeneratorStrategy, prefix+"tokens-generator-strategy", randomTokenStrategy, fmt.Sprintf("Algorithm used to generate new tokens. Supported Values: %s", strings.Join(supportedTokenStrategy, ",")))
73+
f.StringVar(&cfg.TokensGeneratorStrategy, prefix+"tokens-generator-strategy", randomTokenStrategy, fmt.Sprintf("EXPERIMENTAL: Algorithm used to generate new ring tokens. Supported Values: %s", strings.Join(supportedTokenStrategy, ",")))
7474
f.DurationVar(&cfg.HeartbeatPeriod, prefix+"heartbeat-period", 5*time.Second, "Period at which to heartbeat to consul. 0 = disabled.")
7575
f.DurationVar(&cfg.JoinAfter, prefix+"join-after", 0*time.Second, "Period to wait for a claim from another member; will join automatically after this.")
7676
f.DurationVar(&cfg.ObservePeriod, prefix+"observe-period", 0*time.Second, "Observe tokens after generating to resolve collisions. Useful when using gossiping ring.")
@@ -176,9 +176,6 @@ func NewLifecycler(
176176
}
177177

178178
zone := cfg.Zone
179-
if zone != "" {
180-
level.Warn(logger).Log("msg", "experimental feature in use", "feature", "Zone aware replication")
181-
}
182179

183180
// We do allow a nil FlushTransferer, but to keep the ring logic easier we assume
184181
// it's always set, so we use a noop FlushTransferer

0 commit comments

Comments
 (0)