From 8688e9210e261f9c35cdb415928c89eb577c7baf Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Thu, 24 Aug 2017 09:57:14 -0700 Subject: [PATCH] nomad: avoid replication consistency issues by setting MinQueryIndex --- nomad/leader.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nomad/leader.go b/nomad/leader.go index 4fd21f790..825dd9b4f 100644 --- a/nomad/leader.go +++ b/nomad/leader.go @@ -721,9 +721,10 @@ START: req := structs.ACLPolicySetRequest{ Names: update, QueryOptions: structs.QueryOptions{ - Region: s.config.AuthoritativeRegion, - SecretID: s.ReplicationToken(), - AllowStale: true, + Region: s.config.AuthoritativeRegion, + SecretID: s.ReplicationToken(), + AllowStale: true, + MinQueryIndex: resp.Index - 1, }, } var reply structs.ACLPolicySetResponse @@ -865,9 +866,10 @@ START: req := structs.ACLTokenSetRequest{ AccessorIDS: update, QueryOptions: structs.QueryOptions{ - Region: s.config.AuthoritativeRegion, - SecretID: s.ReplicationToken(), - AllowStale: true, + Region: s.config.AuthoritativeRegion, + SecretID: s.ReplicationToken(), + AllowStale: true, + MinQueryIndex: resp.Index - 1, }, } var reply structs.ACLTokenSetResponse