Skip to content

Commit

Permalink
core: fix start up policy loading race condition on perf standbys (ha…
Browse files Browse the repository at this point in the history
…shicorp#17801)

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

* Use correct bool for perf standby

* changelog
  • Loading branch information
jasonodonnell authored and jayant07-yb committed Mar 15, 2023
1 parent 0ec10cd commit 2ce841b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelog/17801.txt
Original file line number Diff line number Diff line change
@@ -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.
```
5 changes: 5 additions & 0 deletions vault/policy_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ func (c *Core) setupPolicyStore(ctx context.Context) error {
return nil
}

if c.perfStandby {
// Policies will sync from the active
return nil
}

// Ensure that the default policy exists, and if not, create it
if err := c.policyStore.loadACLPolicy(ctx, defaultPolicyName, defaultPolicy); err != nil {
return err
Expand Down

0 comments on commit 2ce841b

Please sign in to comment.