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
…7585)

When an alpha would restart, it wasn't reconnecting to the learner
nodes. This PR fixes that.

Fixes DGRAPH-3125

(cherry picked from commit 586181f)
  • Loading branch information
Ibrahim Jarif authored Mar 16, 2021
1 parent e25df9e commit 3db0529
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 3db0529

Please sign in to comment.