From 586181f57abfe719e4e766b4f4be7b99cc55b8e5 Mon Sep 17 00:00:00 2001 From: Ibrahim Jarif Date: Mon, 15 Mar 2021 11:20:46 +0530 Subject: [PATCH] fix(learner nodes): Reconnect to learner nodes after restart (#7554) When an alpha would restart, it wasn't reconnecting to the learner nodes. This PR fixes that. Fixes DGRAPH-3125 --- worker/draft.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/worker/draft.go b/worker/draft.go index 13f2403c696..dd9351a58f8 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -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")