Skip to content

Commit

Permalink
make ingesters use heartbeat timeout instead of period to fix the bug…
Browse files Browse the repository at this point in the history
… where they sometimes appear as unhealthy
  • Loading branch information
zenador committed May 26, 2022
1 parent 46eddd3 commit a78ec87
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* [ENHANCEMENT] Memberlist KV: incoming messages are now processed on per-key goroutine. This may reduce loss of "maintanance" packets in busy memberlist installations, but use more CPU. New `memberlist_client_received_broadcasts_dropped_total` counter tracks number of dropped per-key messages. #1912
* [BUGFIX] Fix regexp parsing panic for regexp label matchers with start/end quantifiers. #1883
* [BUGFIX] Ingester: fixed deceiving error log "failed to update cached shipped blocks after shipper initialisation", occurring for each new tenant in the ingester. #1893
* [BUGFIX] Ring: fix bug where ingesters may appear unhealthy even though they are not #1933

### Mixin

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/golang/snappy v0.0.4
github.com/google/gopacket v1.1.19
github.com/gorilla/mux v1.8.0
github.com/grafana/dskit v0.0.0-20220523143435-f5a17a2c14c8
github.com/grafana/dskit v0.0.0-20220526081034-789ec0ca4a3b
github.com/grafana/e2e v0.1.1-0.20220519104354-1db01e4751fe
github.com/hashicorp/golang-lru v0.5.4
github.com/json-iterator/go v1.1.12
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ github.com/grafana-tools/sdk v0.0.0-20211220201350-966b3088eec9 h1:LQAhgcUPnzdjU
github.com/grafana-tools/sdk v0.0.0-20211220201350-966b3088eec9/go.mod h1:AHHlOEv1+GGQ3ktHMlhuTUwo3zljV3QJbC0+8o2kn+4=
github.com/grafana/dskit v0.0.0-20211021180445-3bd016e9d7f1/go.mod h1:uPG2nyK4CtgNDmWv7qyzYcdI+S90kHHRWvHnBtEMBXM=
github.com/grafana/dskit v0.0.0-20220112093026-95274ccc858d/go.mod h1:M0/dlftwBvH7+hdNNpjMa/CUXD7gsew67mbkCuDlFXE=
github.com/grafana/dskit v0.0.0-20220523143435-f5a17a2c14c8 h1:u7rtjSEjrX/WOGTgRq8ZsNXOv62tRqhkb1gJtNTEzR8=
github.com/grafana/dskit v0.0.0-20220523143435-f5a17a2c14c8/go.mod h1:9It/K30QPyj/FuTqBb/SYnaS4/BJCP5YL4SRfXB7dG0=
github.com/grafana/dskit v0.0.0-20220526081034-789ec0ca4a3b h1:9h79WowXGj6wErMzoi35pBECxnh7ucKJlQTs4Gs0yOI=
github.com/grafana/dskit v0.0.0-20220526081034-789ec0ca4a3b/go.mod h1:9It/K30QPyj/FuTqBb/SYnaS4/BJCP5YL4SRfXB7dG0=
github.com/grafana/e2e v0.1.1-0.20220519104354-1db01e4751fe h1:mxrRWDjKtob43xF9nEhJthdtCzX35/800Sk7nE//YHQ=
github.com/grafana/e2e v0.1.1-0.20220519104354-1db01e4751fe/go.mod h1:+26VJWpczg2OU3D0537acnHSHzhJORpxOs6F+M27tZo=
github.com/grafana/memberlist v0.3.1-0.20220425183535-6b97a09b7167 h1:PgEQkGHR4YimSCEGT5IoswN9gJKZDVskf+he6UClCLw=
Expand Down
1 change: 1 addition & 0 deletions pkg/alertmanager/alertmanager_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func (cfg *RingConfig) ToLifecyclerConfig(logger log.Logger) (ring.BasicLifecycl
ID: cfg.InstanceID,
Addr: fmt.Sprintf("%s:%d", instanceAddr, instancePort),
HeartbeatPeriod: cfg.HeartbeatPeriod,
HeartbeatTimeout: cfg.HeartbeatTimeout,
TokensObservePeriod: 0,
Zone: cfg.InstanceZone,
NumTokens: RingNumTokens,
Expand Down
1 change: 1 addition & 0 deletions pkg/compactor/compactor_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (cfg *RingConfig) ToLifecyclerConfig() ring.LifecyclerConfig {
lc.InfNames = cfg.InstanceInterfaceNames
lc.UnregisterOnShutdown = true
lc.HeartbeatPeriod = cfg.HeartbeatPeriod
lc.HeartbeatTimeout = cfg.HeartbeatTimeout
lc.ObservePeriod = cfg.ObservePeriod
lc.JoinAfter = 0
lc.MinReadyDuration = 0
Expand Down
1 change: 1 addition & 0 deletions pkg/compactor/compactor_ring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestRingConfig_CustomConfigToLifecyclerConfig(t *testing.T) {
// The lifecycler config should be generated based upon the compactor
// ring config
expected.HeartbeatPeriod = cfg.HeartbeatPeriod
expected.HeartbeatTimeout = cfg.HeartbeatTimeout
expected.RingConfig.HeartbeatTimeout = cfg.HeartbeatTimeout
expected.RingConfig.SubringCacheDisabled = true
expected.RingConfig.KVStore.Store = "memberlist"
Expand Down
1 change: 1 addition & 0 deletions pkg/distributor/distributor_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (cfg *RingConfig) ToLifecyclerConfig() ring.LifecyclerConfig {
lc.InfNames = cfg.InstanceInterfaceNames
lc.UnregisterOnShutdown = true
lc.HeartbeatPeriod = cfg.HeartbeatPeriod
lc.HeartbeatTimeout = cfg.HeartbeatTimeout
lc.ObservePeriod = 0
lc.NumTokens = 1
lc.JoinAfter = 0
Expand Down
1 change: 1 addition & 0 deletions pkg/distributor/distributor_ring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestRingConfig_CustomConfigToLifecyclerConfig(t *testing.T) {
// The lifecycler config should be generated based upon the distributor
// ring config
expected.HeartbeatPeriod = cfg.HeartbeatPeriod
expected.HeartbeatTimeout = cfg.HeartbeatTimeout
expected.RingConfig.HeartbeatTimeout = cfg.HeartbeatTimeout
expected.RingConfig.KVStore.Store = "memberlist"
expected.ID = cfg.InstanceID
Expand Down
1 change: 1 addition & 0 deletions pkg/ingester/ingester_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (cfg *RingConfig) ToLifecyclerConfig() ring.LifecyclerConfig {
lc.RingConfig = cfg.ToRingConfig()
lc.NumTokens = cfg.NumTokens
lc.HeartbeatPeriod = cfg.HeartbeatPeriod
lc.HeartbeatTimeout = cfg.HeartbeatTimeout
lc.ObservePeriod = cfg.ObservePeriod
lc.JoinAfter = cfg.JoinAfter
lc.MinReadyDuration = cfg.MinReadyDuration
Expand Down
1 change: 1 addition & 0 deletions pkg/ingester/ingester_ring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func TestRingConfig_CustomConfigToLifecyclerConfig(t *testing.T) {

expected.NumTokens = cfg.NumTokens
expected.HeartbeatPeriod = cfg.HeartbeatPeriod
expected.HeartbeatTimeout = cfg.HeartbeatTimeout
expected.ObservePeriod = cfg.ObservePeriod
expected.JoinAfter = cfg.JoinAfter
expected.MinReadyDuration = cfg.MinReadyDuration
Expand Down
1 change: 1 addition & 0 deletions pkg/ruler/ruler_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (cfg *RingConfig) ToLifecyclerConfig(logger log.Logger) (ring.BasicLifecycl
ID: cfg.InstanceID,
Addr: fmt.Sprintf("%s:%d", instanceAddr, instancePort),
HeartbeatPeriod: cfg.HeartbeatPeriod,
HeartbeatTimeout: cfg.HeartbeatTimeout,
TokensObservePeriod: 0,
NumTokens: cfg.NumTokens,
}, nil
Expand Down
1 change: 1 addition & 0 deletions pkg/storegateway/gateway_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func (cfg *RingConfig) ToLifecyclerConfig(logger log.Logger) (ring.BasicLifecycl
Addr: fmt.Sprintf("%s:%d", instanceAddr, instancePort),
Zone: cfg.InstanceZone,
HeartbeatPeriod: cfg.HeartbeatPeriod,
HeartbeatTimeout: cfg.HeartbeatTimeout,
TokensObservePeriod: 0,
NumTokens: RingNumTokens,
KeepInstanceInTheRingOnShutdown: !cfg.UnregisterOnShutdown,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions vendor/github.com/grafana/dskit/ring/http.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vendor/github.com/grafana/dskit/ring/lifecycler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a78ec87

Please sign in to comment.