mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
client/metadata: fix crasher caused by AllowStale = false (#16549)
Fixes #16517 Given a 3 Server cluster with at least 1 Client connected to Follower 1: If a NodeMeta.{Apply,Read} for the Client request is received by Follower 1 with `AllowStale = false` the Follower will forward the request to the Leader. The Leader, not being connected to the target Client, will forward the RPC to Follower 1. Follower 1, seeing AllowStale=false, will forward the request to the Leader. The Leader, not being connected to... well hoppefully you get the picture: an infinite loop occurs.
This commit is contained in:
@@ -30,9 +30,9 @@ func (n *Nodes) Meta() *NodeMeta {
|
||||
|
||||
// Apply dynamic Node metadata updates to a Node. If NodeID is unset then Node
|
||||
// receiving the request is modified.
|
||||
func (n *NodeMeta) Apply(meta *NodeMetaApplyRequest, qo *WriteOptions) (*NodeMetaResponse, error) {
|
||||
func (n *NodeMeta) Apply(meta *NodeMetaApplyRequest, qo *QueryOptions) (*NodeMetaResponse, error) {
|
||||
var out NodeMetaResponse
|
||||
_, err := n.client.post("/v1/client/metadata", meta, &out, qo)
|
||||
_, err := n.client.postQuery("/v1/client/metadata", meta, &out, qo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user