Skip to content

Commit

Permalink
feat(distributor): add experimental memberlist kvStore for ha_tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAnge committed Nov 29, 2024
1 parent 37d5e00 commit 3b2f0db
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<prometheus-http-prefix>/api/v1/rules` endpoint. #9300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,8 @@ ha_tracker:
# CLI flag: -distributor.ha-tracker.failover-timeout
[ha_tracker_failover_timeout: <duration> | 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.
Expand Down
7 changes: 1 addition & 6 deletions pkg/distributor/ha_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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 {
Expand Down Expand Up @@ -75,7 +74,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.
Expand Down Expand Up @@ -103,10 +102,6 @@ func (cfg *HATrackerConfig) Validate() error {
return fmt.Errorf(errInvalidFailoverTimeout, cfg.FailoverTimeout, minFailureTimeout)
}

if cfg.KVStore.Store == "memberlist" {
return errMemberlistUnsupported
}

return nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/distributor/ha_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ 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)
cfg.KVStore.Store = "memberlist"

return cfg
}(),
expectedErr: errMemberlistUnsupported,
expectedErr: nil,
},
}

Expand Down

0 comments on commit 3b2f0db

Please sign in to comment.