Skip to content
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

Merged
merged 4 commits into from
Jan 28, 2021
Merged

Add in leader elected and lost quorum advisories. #1857

merged 4 commits into from
Jan 28, 2021

Conversation

derekcollison
Copy link
Member

/cc @nats-io/core

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>
Copy link
Contributor

@ripienaar ripienaar left a 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

Time: time.Now().UTC(),
},
Stream: stream,
State: mset.State(),
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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 :)

@derekcollison
Copy link
Member Author

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>
Copy link
Contributor

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 7d21488 into master Jan 28, 2021
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.

2 participants