Skip to content

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

Merged
martinmr merged 1 commit intorelease/v20.03from
martinmr/cp-raft203
Jun 9, 2020
Merged

(release/v20.03) Avoid assigning duplicate RAFT IDs to new nodes#5604
martinmr merged 1 commit intorelease/v20.03from
martinmr/cp-raft203

Conversation

@martinmr
Copy link
Copy Markdown
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 a review from manishrjain as a code owner June 8, 2020 18:58
@martinmr martinmr requested a review from a team 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
Copy Markdown
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