Skip to content

Conversation

@stevesg
Copy link
Contributor

@stevesg stevesg commented Jul 6, 2021

What this PR does:
This change allows the various ring heartbeat timeouts to be configured
with zero, as a means of disabling the timeout. This is expected to be
used with a separate enhancement to allow disabling heartbeats. When the
heartbeat timeout is disabled, instances will always appear as healthy
in the ring.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@stevesg stevesg force-pushed the ring-timeout-disable branch from 566df03 to 16a505e Compare July 6, 2021 14:09
This change allows the various ring heartbeat timeouts to be configured
with zero, as a means of disabling the timeout. This is expected to be
used with a separate enhancement to allow disabling heartbeats. When the
heartbeat timeout is disabled, instances will always appear as healthy
in the ring.

Signed-off-by: Steve Simpson <[email protected]>
@stevesg stevesg force-pushed the ring-timeout-disable branch from 16a505e to e0bd75e Compare July 6, 2021 14:10
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change LGTM. I guess we'll need a follow up PR to also allow disabling heartbeating the ring at all (this PR just checks the timeout). What your plans on this?

About this PR: I would mention it as an experimental feature in docs/configuration/v1-guarantees.md

@stevesg
Copy link
Contributor Author

stevesg commented Jul 7, 2021

The two changes together were very confusing as they spread to so many bits of code in subtly different ways, so the disabling is here: #4344

Signed-off-by: Steve Simpson <[email protected]>
@stevesg stevesg marked this pull request as ready for review July 7, 2021 09:53
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - I don't think the word "experimental" is necessary but not going to argue.

@pracucci pracucci merged commit ed62246 into cortexproject:master Jul 9, 2021
alvinlin123 pushed a commit to ac1214/cortex that referenced this pull request Jan 14, 2022
cortexproject#4342)

* Allow setting ring heartbeat timeout to zero to disable timeout check.

This change allows the various ring heartbeat timeouts to be configured
with zero, as a means of disabling the timeout. This is expected to be
used with a separate enhancement to allow disabling heartbeats. When the
heartbeat timeout is disabled, instances will always appear as healthy
in the ring.

Signed-off-by: Steve Simpson <[email protected]>

* Review comments.

Signed-off-by: Steve Simpson <[email protected]>
Signed-off-by: Alvin Lin <[email protected]>
dimitarvdimitrov added a commit to grafana/dskit that referenced this pull request Oct 23, 2025
## What

Removes the experimental feature that allowed setting heartbeat period
or timeout to 0 to disable them.

## Why

This feature was added in
cortexproject/cortex#4342 but is not used in
production. Removing unused experimental features simplifies the
codebase and reduces maintenance burden.

## Changes

- Remove "0 = disabled" from flag descriptions for
`-*.ring.heartbeat-period` and `-*.ring.heartbeat-timeout`
- Add validation to `LifecyclerConfig.Validate()` and
`Config.Validate()` to reject zero values
- Delete
`TestRestartIngester_DisabledHeartbeat_unregister_on_shutdown_false`
test
- Update tests that were using zero heartbeat values to use non-zero
values
- Fix metric tests to use recent timestamps that work with non-zero
heartbeat timeouts
dimitarvdimitrov added a commit to grafana/mimir that referenced this pull request Oct 29, 2025
## What

Removes support for setting heartbeat period or timeout to 0 to disable
them.

## Why

This experimental feature was added in
cortexproject/cortex#4342 but is not used in
production. Removing unused experimental features simplifies the
codebase.

## Changes

- Remove "Hash ring" section from experimental features documentation
listing the heartbeat disabling flags
- Add CHANGELOG entry under `[CHANGE]` scope
- Update dskit dependency to include validation changes (via replace
directive for now)

## Dependencies

This PR depends on grafana/dskit#759 which must
be merged first. After that PR is merged, this PR will be updated to:
1. Remove the replace directive
2. Update dskit to the merged commit
3. Update the CHANGELOG with the actual PR number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants