ACL RPCs allow stale reads for scalability
This commit is contained in:
parent
31b39f8a71
commit
b8bf35f087
|
@ -124,8 +124,11 @@ func (c *Client) resolveTokenValue(secretID string) (*structs.ACLToken, error) {
|
|||
|
||||
// Lookup the token
|
||||
req := structs.ResolveACLTokenRequest{
|
||||
SecretID: secretID,
|
||||
QueryOptions: structs.QueryOptions{Region: c.Region()},
|
||||
SecretID: secretID,
|
||||
QueryOptions: structs.QueryOptions{
|
||||
Region: c.Region(),
|
||||
AllowStale: true,
|
||||
},
|
||||
}
|
||||
var resp structs.ResolveACLTokenResponse
|
||||
if err := c.RPC("ACL.ResolveToken", &req, &resp); err != nil {
|
||||
|
@ -186,8 +189,9 @@ func (c *Client) resolvePolicies(secretID string, policies []string) ([]*structs
|
|||
req := structs.ACLPolicySetRequest{
|
||||
Names: fetch,
|
||||
QueryOptions: structs.QueryOptions{
|
||||
Region: c.Region(),
|
||||
SecretID: secretID,
|
||||
Region: c.Region(),
|
||||
SecretID: secretID,
|
||||
AllowStale: true,
|
||||
},
|
||||
}
|
||||
var resp structs.ACLPolicySetResponse
|
||||
|
|
|
@ -674,7 +674,8 @@ REMOVE:
|
|||
func (s *Server) replicateACLPolicies(stopCh chan struct{}) {
|
||||
req := structs.ACLPolicyListRequest{
|
||||
QueryOptions: structs.QueryOptions{
|
||||
Region: s.config.AuthoritativeRegion,
|
||||
Region: s.config.AuthoritativeRegion,
|
||||
AllowStale: true,
|
||||
},
|
||||
}
|
||||
limiter := rate.NewLimiter(replicationRateLimit, int(replicationRateLimit))
|
||||
|
@ -720,8 +721,9 @@ START:
|
|||
req := structs.ACLPolicySetRequest{
|
||||
Names: update,
|
||||
QueryOptions: structs.QueryOptions{
|
||||
Region: s.config.AuthoritativeRegion,
|
||||
SecretID: s.ReplicationToken(),
|
||||
Region: s.config.AuthoritativeRegion,
|
||||
SecretID: s.ReplicationToken(),
|
||||
AllowStale: true,
|
||||
},
|
||||
}
|
||||
var reply structs.ACLPolicySetResponse
|
||||
|
@ -816,7 +818,8 @@ func (s *Server) replicateACLTokens(stopCh chan struct{}) {
|
|||
req := structs.ACLTokenListRequest{
|
||||
GlobalOnly: true,
|
||||
QueryOptions: structs.QueryOptions{
|
||||
Region: s.config.AuthoritativeRegion,
|
||||
Region: s.config.AuthoritativeRegion,
|
||||
AllowStale: true,
|
||||
},
|
||||
}
|
||||
limiter := rate.NewLimiter(replicationRateLimit, int(replicationRateLimit))
|
||||
|
@ -862,8 +865,9 @@ START:
|
|||
req := structs.ACLTokenSetRequest{
|
||||
AccessorIDS: update,
|
||||
QueryOptions: structs.QueryOptions{
|
||||
Region: s.config.AuthoritativeRegion,
|
||||
SecretID: s.ReplicationToken(),
|
||||
Region: s.config.AuthoritativeRegion,
|
||||
SecretID: s.ReplicationToken(),
|
||||
AllowStale: true,
|
||||
},
|
||||
}
|
||||
var reply structs.ACLTokenSetResponse
|
||||
|
|
Loading…
Reference in New Issue