Skip to content

Fix issue#317 Perfect kvrocks-controller election #318

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

Closed
wants to merge 2 commits into from

Conversation

hll1213181368
Copy link

Perfect kvrocks-controller election #317

@@ -173,6 +173,11 @@ func (shard *Shard) getNewMasterNodeIndex(ctx context.Context, masterNodeIndex i
if clusterNodeInfo.Sequence >= newestOffset {
newMasterNodeIndex = i
newestOffset = clusterNodeInfo.Sequence

// only when the slave nodes's master_link_status is not up can be selected as the new master
if clusterNodeInfo.MasterLinkStatus != "up" {
Copy link
Member

Choose a reason for hiding this comment

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

Should move this after line 167, and continue if the master link is broken.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks hulk advise! I resubmitted the fix code, please check it out

Copy link
Member

Choose a reason for hiding this comment

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

Thank you!

Copy link
Member

Choose a reason for hiding this comment

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

@hll1213181368 I realized that we cannot simply filter by the master link status, because all replicas would be in down state if the master node is not present.

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