mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
[VAULT-708] Zero out request counter on preSeal (#11970)
* [VAULT-708] Zero out request counter on preSeal * [VAULT-708] Added changelog entry * [VAULT-708] Add comment clarifying request counter zeroing
This commit is contained in:
committed by
GitHub
parent
b282ca8674
commit
6b8e4dcf2f
3
changelog/11970.txt
Normal file
3
changelog/11970.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
core: Fixed double counting of http requests after operator stepdown
|
||||||
|
```
|
||||||
@@ -2183,6 +2183,12 @@ func (c *Core) preSeal() error {
|
|||||||
if err := c.unloadMounts(context.Background()); err != nil {
|
if err := c.unloadMounts(context.Background()); err != nil {
|
||||||
result = multierror.Append(result, fmt.Errorf("error unloading mounts: %w", err))
|
result = multierror.Append(result, fmt.Errorf("error unloading mounts: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Zeros out the requests counter to avoid sending all requests for the month on stepdown
|
||||||
|
// when this runs on the active node. Unseal does the complementary operation of loading
|
||||||
|
// the counter from storage, so this operation should be a safe one.
|
||||||
|
atomic.StoreUint64(c.counters.requests, 0)
|
||||||
|
|
||||||
if err := enterprisePreSeal(c); err != nil {
|
if err := enterprisePreSeal(c); err != nil {
|
||||||
result = multierror.Append(result, err)
|
result = multierror.Append(result, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user