Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(learner nodes): Reconnect to learner nodes after restart #7554

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Mar 11, 2021

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


This change is Reviewable

When an alpha would restart, it wasn't reconnecting to the learner
nodes. This PR fixes that.
@@ -1760,6 +1760,12 @@ func (n *node) InitAndStartNode() {
n.Connect(id, m.Addr)
}
}
for _, id := range sp.Metadata.ConfState.Learners {
m, ok := members[id]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why this check is necessary. The loop above had the check and so I've added it.

Copy link
Contributor

@NamanJain8 NamanJain8 Mar 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be needed because of the following reason. Not sure though.
Say an alpha node has a stale snapshot and the cluster has progressed (some nodes added/deleted). When we restart that node, it first gets the snapshot from the WAL and verifies that it actually exists in latest membership state. If yes, then it connects to it.

This change will also mean that learner nodes will connect among themselves. Is that expected behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will also mean that learner nodes will connect among themselves. Is that expected behaviour?

That's expected. All alphas connect to all other alphas.

@jarifibrahim jarifibrahim merged commit 586181f into master Mar 15, 2021
jarifibrahim pushed a commit that referenced this pull request Mar 16, 2021
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)
jarifibrahim pushed a commit that referenced this pull request Mar 16, 2021
…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)
@jarifibrahim jarifibrahim deleted the ibrahim/leaner-reconnect branch March 24, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants