core: fix start up policy loading race condition on perf standbys (#17801)

* core: fix start up policy loading race condition on perf standbys

* Use correct bool for perf standby

* changelog
This commit is contained in:
Jason O'Donnell 2022-11-03 13:01:39 -04:00 committed by GitHub
parent 404422dba1
commit 4e122214f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

4
changelog/17801.txt Normal file
View File

@ -0,0 +1,4 @@
```release-note:bug
core: fix a start up race condition where performance standbys could go into a
mount loop if default policies are not yet synced from the active node.
```

View File

@ -264,6 +264,11 @@ func (c *Core) setupPolicyStore(ctx context.Context) error {
return nil return nil
} }
if c.perfStandby {
// Policies will sync from the active
return nil
}
// Ensure that the default policy exists, and if not, create it // Ensure that the default policy exists, and if not, create it
if err := c.policyStore.loadACLPolicy(ctx, defaultPolicyName, defaultPolicy); err != nil { if err := c.policyStore.loadACLPolicy(ctx, defaultPolicyName, defaultPolicy); err != nil {
return err return err