Skip to content

Conversation

@pstibrany
Copy link
Contributor

What this PR does:
This PR changes lifecycler initialization such that it always updates ring immediately when it finds existing ring entry that it can reuse, instead of waiting for next heartbeat, since heartbeat period can be configured with long time.

Which issue(s) this PR fixes:

Fixes #174

Checklist

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

@pstibrany pstibrany requested a review from pracucci June 10, 2022 12:35
if i.cfg.HeartbeatPeriod == 0 && !instanceDesc.Equal(ringDesc.Ingesters[i.ID]) {
// Update the ring if the instance has been changed. We don't want to rely on heartbeat update, as heartbeat
// can be configured to long time, and until then lifecycler would not report this instance as ready in CheckReady.
if !instanceDesc.Equal(ringDesc.Ingesters[i.ID]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It was also part of a change I tried to do in Cortex long time ago, but was never merged:
https://github.com/cortexproject/cortex/pull/3774/files

Just saying that it did look a good idea to me back in time, and it still does.

Co-authored-by: Marco Pracucci <[email protected]>
@pstibrany pstibrany enabled auto-merge (squash) June 13, 2022 09:07
@pstibrany pstibrany merged commit ebb5c6d into main Jun 13, 2022
@pstibrany pstibrany deleted the fix-issue-174 branch June 13, 2022 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When lifecycler reuses existing LEAVING entry, it waits for another heartbeat period to write ACTIVE state to ring

2 participants