-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Forward autopilot state reqs, avoid self-dialing #15493
Conversation
…de state. Forward autopilot state requests to the active node. Avoid self-dialing due to stale advertisement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
// At the top of this function we return early when we're the active node. | ||
// If we're not the active node, and there's a stale advertisement pointing | ||
// to ourself, there's no point in paying any attention to it. And by | ||
// disregarding it, we can avoid a panic in raft tests using the Inmem network | ||
// layer when we try to connect back to ourself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this comment, thanks!
…rcising redirection.
// to ourself, there's no point in paying any attention to it. And by | ||
// disregarding it, we can avoid a panic in raft tests using the Inmem network | ||
// layer when we try to connect back to ourself. | ||
if adv.ClusterAddr == c.ClusterAddr() && adv.RedirectAddr == c.redirectAddr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to also take RedirectAddr into consideration, otherwise tests that exercise redirection (and thus don't have a valid cluster addr) would break.
Make sure that autopilot is disabled when we step down from active node state. Forward autopilot state requests to the active node. Avoid self-dialing due to stale advertisement.
Make sure that autopilot is disabled when we step down from active node state. Forward autopilot state requests to the active node. Avoid self-dialing due to stale advertisement from when we used to be active node.