Skip to content

Commit

Permalink
Add paths for seal config to cache exceptions. (#21223) (#21320)
Browse files Browse the repository at this point in the history
Add paths for seal config to cache exceptions.

Add barrierSealConfigPath and recoverySealConfigPlaintextPath to
cacheExceptionsPaths in order to avoid a race that causes some
nodes to always see a nil value.

Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
  • Loading branch information
ryancragun and victorr authored Jun 16, 2023
1 parent b43bfc8 commit 97d7f0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/21223.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
core: Do not cache seal configuration to fix a bug that resulted in sporadic auto unseal failures.
```
6 changes: 6 additions & 0 deletions sdk/physical/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"sync/atomic"

metrics "github.com/armon/go-metrics"

log "github.com/hashicorp/go-hclog"
lru "github.com/hashicorp/golang-lru"
"github.com/hashicorp/vault/sdk/helper/locksutil"
Expand All @@ -30,6 +31,11 @@ var cacheExceptionsPaths = []string{
"core/poison-pill",
"core/raft/tls",
"core/license",

// Add barrierSealConfigPath and recoverySealConfigPlaintextPath to the cache
// exceptions to avoid unseal errors. See VAULT-17227
"core/seal-config",
"core/recovery-config",
}

// CacheRefreshContext returns a context with an added value denoting if the
Expand Down

0 comments on commit 97d7f0b

Please sign in to comment.