-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add in leader elected and lost quorum advisories. #1857
Conversation
Signed-off-by: Derek Collison <derek@nats.io>
Note that quorum lost only fires if the old leader steps down. If the leader itself fails and that causes the loss of quorum currently no advisory is sent. Signed-off-by: Derek Collison <derek@nats.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a q, otherwise, LGTM
server/jetstream_cluster.go
Outdated
Time: time.Now().UTC(), | ||
}, | ||
Stream: stream, | ||
State: mset.State(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without consumer state i wonder if its worth having this really? I am not sure what I'll do with this info if I had it, what did you have in mind as a usecase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you do with state here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of anything I'd do with it :)
FYI this approach is a bit more fragile than I want, requires old leader to not be the one lost to lose quorum. Have an idea I am going to try to make it more robust. Will update PR if it works. |
We will now alert when the old leader detects a lost quorum just as before, but also detect if a candidate is flapping and failing to get votes because of no quorum. Signed-off-by: Derek Collison <derek@nats.io>
Signed-off-by: Derek Collison <derek@nats.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/cc @nats-io/core