From 3b4d8c79965b9a74b7b679cb77bfb06214e02fed Mon Sep 17 00:00:00 2001 From: Nikos Angelopoulos Date: Fri, 29 Nov 2024 11:29:05 +0100 Subject: [PATCH] feat(distributor): add experimental `memberlist` kvStore for ha_tracker --- CHANGELOG.md | 1 + .../mimir/configure/configuration-parameters/index.md | 5 ++--- pkg/distributor/ha_tracker.go | 7 +------ pkg/distributor/ha_tracker_test.go | 4 ++-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86876f9663a..9935c262081 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ * [FEATURE] PromQL: Add experimental `info` function. Experimental functions are disabled by default, but can be enabled setting `-querier.promql-experimental-functions-enabled=true` in the query-frontend and querier. #9879 * [FEATURE] Distributor: Support promotion of OTel resource attributes to labels. #8271 * [FEATURE] Querier: Add experimental `double_exponential_smoothing` PromQL function. Experimental functions are disabled by default, but can be enabled by setting `-querier.promql-experimental-functions-enabled=true` in the query-frontend and querier. #9844 +* [FEATURE] Distributor: Add experimental `memberlist` kvStore for ha_tracker. Memberlist parameters can be changed through `-memberlist-*` flags * [ENHANCEMENT] Query Frontend: Return server-side `bytes_processed` statistics following Server-Timing format. #9645 #9985 * [ENHANCEMENT] mimirtool: Adds bearer token support for mimirtool's analyze ruler/prometheus commands. #9587 * [ENHANCEMENT] Ruler: Support `exclude_alerts` parameter in `/api/v1/rules` endpoint. #9300 diff --git a/docs/sources/mimir/configure/configuration-parameters/index.md b/docs/sources/mimir/configure/configuration-parameters/index.md index bfd77794a8a..79994fa9b85 100644 --- a/docs/sources/mimir/configure/configuration-parameters/index.md +++ b/docs/sources/mimir/configure/configuration-parameters/index.md @@ -804,9 +804,8 @@ ha_tracker: # CLI flag: -distributor.ha-tracker.failover-timeout [ha_tracker_failover_timeout: | default = 30s] - # Backend storage to use for the ring. Please be aware that memberlist is not - # supported by the HA tracker since gossip propagation is too slow for HA - # purposes. + # Backend storage to use for the ring. Please be aware that memberlist is + # supported by the HA tracker but its experimental. kvstore: # Backend storage to use for the ring. Supported values are: consul, etcd, # inmemory, memberlist, multi. diff --git a/pkg/distributor/ha_tracker.go b/pkg/distributor/ha_tracker.go index 1db18d603c2..b420b9ca609 100644 --- a/pkg/distributor/ha_tracker.go +++ b/pkg/distributor/ha_tracker.go @@ -34,7 +34,6 @@ import ( var ( errNegativeUpdateTimeoutJitterMax = errors.New("HA tracker max update timeout jitter shouldn't be negative") errInvalidFailoverTimeout = "HA Tracker failover timeout (%v) must be at least 1s greater than update timeout - max jitter (%v)" - errMemberlistUnsupported = errors.New("memberlist is not supported by the HA tracker since gossip propagation is too slow for HA purposes") ) type haTrackerLimits interface { @@ -147,7 +146,7 @@ type HATrackerConfig struct { // more than this duration FailoverTimeout time.Duration `yaml:"ha_tracker_failover_timeout" category:"advanced"` - KVStore kv.Config `yaml:"kvstore" doc:"description=Backend storage to use for the ring. Please be aware that memberlist is not supported by the HA tracker since gossip propagation is too slow for HA purposes."` + KVStore kv.Config `yaml:"kvstore" doc:"description=Backend storage to use for the ring. Please be aware that memberlist is supported by the HA tracker but its experimental."` } // RegisterFlags adds the flags required to config this to the given FlagSet. @@ -175,10 +174,6 @@ func (cfg *HATrackerConfig) Validate() error { return fmt.Errorf(errInvalidFailoverTimeout, cfg.FailoverTimeout, minFailureTimeout) } - if cfg.KVStore.Store == "memberlist" { - return errMemberlistUnsupported - } - return nil } diff --git a/pkg/distributor/ha_tracker_test.go b/pkg/distributor/ha_tracker_test.go index f596e5e4c4e..f604f24d454 100644 --- a/pkg/distributor/ha_tracker_test.go +++ b/pkg/distributor/ha_tracker_test.go @@ -423,7 +423,7 @@ func TestHATrackerConfig_Validate(t *testing.T) { }(), expectedErr: nil, }, - "should fail if KV backend is set to memberlist": { + "should pass if KV backend is set to memberlist": { cfg: func() HATrackerConfig { cfg := HATrackerConfig{} flagext.DefaultValues(&cfg) @@ -431,7 +431,7 @@ func TestHATrackerConfig_Validate(t *testing.T) { return cfg }(), - expectedErr: errMemberlistUnsupported, + expectedErr: nil, }, }