Skip to content

Commit

Permalink
(release/v20.03) Update nextRaftId when starting a node with a raftId…
Browse files Browse the repository at this point in the history
… > 0. (#6598)

If we don't do that, the next node that starts with an ID of zero
(auto-assign) will be assigned an existing ID.

DGRAPH-2496

(cherry picked from commit a4f21f4)
  • Loading branch information
martinmr committed Oct 4, 2020
1 parent 555aab6 commit 33c6f4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dgraph/cmd/zero/zero.go
Expand Up @@ -502,6 +502,9 @@ func (s *Server) Connect(ctx context.Context,
m.Id = s.nextRaftId
s.nextRaftId += 1
proposal.MaxRaftId = m.Id
} else if m.Id >= s.nextRaftId {
s.nextRaftId = m.Id + 1
proposal.MaxRaftId = m.Id
}

// We don't have this member. So, let's see if it has preference for a group.
Expand Down

0 comments on commit 33c6f4e

Please sign in to comment.