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

(release/v20.03) Avoid assigning duplicate RAFT IDs to new nodes #5604

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented Jun 8, 2020

Currently, zero uses the MaxRaftId to assign RAFT IDs to new nodes. However, the
MaxRaftId value is not immediately updated and the lock is released in between
creating the proposal and sending the proposal to the RAFT node. This can lead
to situations where more than one new node is assigned the same ID.

To solve this, this change introduces a new field to generate the IDs that is
updated immediately, thus preventing multiple nodes from being assigned
the same ID.

Fixes #5436

cherry-picked from c093805


This change is Reviewable

Docs Preview: Dgraph Preview

Currently, zero uses the MaxRaftId to assign RAFT IDs to new nodes. However, the
MaxRaftId value is not immediately updated and the lock is released in between
creating the proposal and sending the proposal to the RAFT node. This can lead
to situations where more than one new node is assigned the same ID.

To solve this, this change introduces a new field to generate the IDs that is
updated immediately, thus preventing multiple nodes from being assigned
the same ID.

Fixes #5436
@martinmr martinmr requested review from manishrjain and a team as code owners June 8, 2020 18:58
@martinmr martinmr changed the title Avoid assigning duplicate RAFT IDs to new nodes. (#5571) (release/v20.03) Avoid assigning duplicate RAFT IDs to new nodes Jun 8, 2020
Copy link
Contributor

@danielmai danielmai left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain)

@martinmr martinmr merged commit dfca80d into release/v20.03 Jun 9, 2020
@martinmr martinmr deleted the martinmr/cp-raft203 branch June 9, 2020 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants