Add a comment around why we are grabbing a lock to update an atomic boolean (#19087)

This commit is contained in:
Steven Clark
2023-02-09 09:12:37 -05:00
committed by GitHub
parent 8958d00263
commit afd9e82e9b
2 changed files with 9 additions and 0 deletions

View File

@@ -416,6 +416,12 @@ func (b *backend) updatePkiStorageVersion(ctx context.Context, grabIssuersLock b
return
}
// If this method is called outside the initialize function, like say an
// invalidate func on a performance replica cluster, we should be grabbing
// the issuers lock to offer a consistent view of the storage version while
// other events are processing things. Its unknown what might happen during
// a single event if one part thinks we are in legacy mode, and then later
// on we aren't.
if grabIssuersLock {
b.issuersLock.Lock()
defer b.issuersLock.Unlock()

3
changelog/19037.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
secrets/pki: Revert fix for PR [18938](https://github.com/hashicorp/vault/pull/18938)
```