Skip to content

Commit

Permalink
fix(learner nodes): Reconnect to learner nodes after restart (#7554)
Browse files Browse the repository at this point in the history
When an alpha would restart, it wasn't reconnecting to the learner
nodes. This PR fixes that.

Fixes DGRAPH-3125
  • Loading branch information
Ibrahim Jarif authored Mar 15, 2021
1 parent 501a120 commit 586181f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions worker/draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,12 @@ func (n *node) InitAndStartNode() {
n.Connect(id, m.Addr)
}
}
for _, id := range sp.Metadata.ConfState.Learners {
m, ok := members[id]
if ok {
n.Connect(id, m.Addr)
}
}
}
n.SetRaft(raft.RestartNode(n.Cfg))
glog.V(2).Infoln("Restart node complete")
Expand Down

0 comments on commit 586181f

Please sign in to comment.