Skip to content

NRG: Stepping down from preferred candidate #6851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

MauriceVanVeen
Copy link
Member

A stream/consumer is already leader when it's R1. When it's scaled up, it remains leader and is preferred to be the leader of the Raft group. However, if it's in candidate state and doesn't get elected, it would not signal back to JetStream that it's not leader anymore once a new leader comes up.

This resulted in various weird situations where:

  • Two leaders could be responding to requests; the new (real) leader, and the old (R1) leader.
  • Various stream/consumer reporting would stop functioning properly, although they'd still be functional.

This is hard to reproduce normally, because the preferred leader nearly always gets elected.

Resolves #6838

Signed-off-by: Maurice van Veen [email protected]

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner April 30, 2025 12:44
Copy link
Member

@derekcollison derekcollison 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
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit ba329b9 into main Apr 30, 2025
125 of 130 checks passed
@neilalexander neilalexander deleted the maurice/nrg-diff-preferred-leader branch April 30, 2025 13:38
neilalexander added a commit that referenced this pull request Apr 30, 2025
Includes the following:

- #6851
- #6849

[skip ci]

Signed-off-by: Neil Twigg <[email protected]>
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.

Scaling JetStream from 1 replica to more than 1 replica causes "group node missing" and broken consumer errors
3 participants