Skip to content

Commit 0f2807b

Browse files
authored
(release/v20.07) Update nextRaftId when starting a node with a raftId > 0. (#6597)
(cherry picked from commit a4f21f4)
1 parent 483d3ff commit 0f2807b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dgraph/cmd/zero/zero.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ func (s *Server) Connect(ctx context.Context,
502502
m.Id = s.nextRaftId
503503
s.nextRaftId += 1
504504
proposal.MaxRaftId = m.Id
505+
} else if m.Id >= s.nextRaftId {
506+
s.nextRaftId = m.Id + 1
507+
proposal.MaxRaftId = m.Id
505508
}
506509

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

0 commit comments

Comments
 (0)