Skip to content

Commit

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

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 authored Oct 3, 2020
1 parent 707c178 commit e3ff4b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dgraph/cmd/zero/zero.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,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 e3ff4b4

Please sign in to comment.