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

Single Node / Dev Cluster starts emitting RPC errors after 2 minutes of running #8401

Closed
mkeeler opened this issue Jul 29, 2020 · 0 comments · Fixed by #8406
Closed

Single Node / Dev Cluster starts emitting RPC errors after 2 minutes of running #8401

mkeeler opened this issue Jul 29, 2020 · 0 comments · Fixed by #8406
Labels
theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics type/bug Feature does not function as expected

Comments

@mkeeler
Copy link
Member

mkeeler commented Jul 29, 2020

The RPC router will rebalance the server lists to rotate which server should be used for the next RPC in that DC on a scaled interval. In a single node cluster or when running consul agent -dev this happens after 2 minutes of running.

#7735 added this bit of code into the rebalancing method:

// check to see if the manager is trying to ping itself,
// continue if that is the case.
if m.serverName != "" && srv.Name == m.serverName {
continue
}

It checks if the server in the list is itself and skips the check if so. Then further down in the method we set the online/offline status:

// If no healthy servers were found, sleep and wait for Serf to make
// the world a happy place again. Update the offline status.
if foundHealthyServer {
atomic.StoreInt32(&m.offline, 0)
} else {
atomic.StoreInt32(&m.offline, 1)
m.logger.Debug("No healthy servers during rebalance, aborting")
return
}

The problem is that for single node clusters we never set foundHealthyServer so after 2 minutes we unconditionally mark that DC as failed.

After all this happens and the DC gets marked as offline. Some RPC will start to fail. In particular if you do a keyring listing via the CLI it will fail with a message saying "Remote DC has no server currently reachable"

@dnephin dnephin added theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics type/bug Feature does not function as expected labels Jul 29, 2020
hanshasselberg added a commit that referenced this issue Jul 30, 2020
This code started as an optimization to avoid doing an RPC Ping to
itself. But in a single server cluster the rebalancing was led to
believe that there were no healthy servers because foundHealthyServer
was not set. Now this is being set properly.

Fixes #8401 and #8403.
hanshasselberg added a commit that referenced this issue Aug 6, 2020
This code started as an optimization to avoid doing an RPC Ping to
itself. But in a single server cluster the rebalancing was led to
believe that there were no healthy servers because foundHealthyServer
was not set. Now this is being set properly.

Fixes #8401 and #8403.
hashicorp-ci pushed a commit that referenced this issue Aug 6, 2020
This code started as an optimization to avoid doing an RPC Ping to
itself. But in a single server cluster the rebalancing was led to
believe that there were no healthy servers because foundHealthyServer
was not set. Now this is being set properly.

Fixes #8401 and #8403.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics type/bug Feature does not function as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants