-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
HA active node information is never updated when both node under VIP #17357
Comments
https://github.com/hashicorp/vault/blob/main/vault/ha.go#L193 should look like // 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.
if adv.ClusterAddr == c.ClusterAddr() && adv.RedirectAddr == c.redirectAddr && clusterLeaderParams != nil {
return false, "", "", nil
} |
@mpalmi if the above solution applicable, would be happy to raise an PR |
Hi @shaj13, Can you explain more about your setup? How is it that both nodes in your cluster can share the same api and cluster addrs? |
2 nodes (active and standby) running k3s and one of the pod is vault, alongside RDS PostgreSQL. In front of the two nodes there a virtual IP, However vault cluster and API address configured with VIP. |
I can see why you might want to set RedirectAddr the same on both nodes in that case. I don't think they should share the same ClusterAddr though. How do you avoid self-dialing in that case? |
@ncabatoff Good question, The state machine of vaults HA is either in standby or active. Anyway the VIP is wrapped with dns, therefore there will be dns lockup to get the actual VIP. |
Describe the bug
HA active node information is never updated when both nodes configuration cluster and API address point to a virtual IP,
The core periodic leader refresh keeps refreshing the active node information but it never updates or caches the clusterLeaderParams due to the check https://github.com/hashicorp/vault/blob/main/vault/ha.go#L193,
so when a client sends an HTTP request to a standby node it returns
local node not active but active cluster node not found
In v1.9.4 the cluster can update and cache clusterLeaderParams even if active and standby nodes have the same cluster and API address, with v1.11.X this is broken.
To Reproduce
local node not active but active cluster node not found
Expected behavior
HA https://github.com/hashicorp/vault/blob/main/vault/ha.go#L92 Leader func update clusterLeaderParams even when active and standby have the same address for the first time.
Vault server configuration file(s):
The text was updated successfully, but these errors were encountered: