From c97b9820435a01e0d10f31567fbbd23923555a45 Mon Sep 17 00:00:00 2001 From: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com> Date: Thu, 11 Aug 2022 16:22:53 -0400 Subject: [PATCH] secret/database: fix bug where too many wal deletes are deferred (#16686) * secret/database: fix bug where too many wal deletes are deferred * changelog * Update changelog/16686.txt Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com> Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com> --- builtin/logical/database/rotation.go | 2 +- changelog/16686.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/16686.txt diff --git a/builtin/logical/database/rotation.go b/builtin/logical/database/rotation.go index f69430ab8..0aee4756b 100644 --- a/builtin/logical/database/rotation.go +++ b/builtin/logical/database/rotation.go @@ -537,7 +537,7 @@ func (b *databaseBackend) initQueue(ctx context.Context, conf *logical.BackendCo } walID, err := framework.PutWAL(ctx, conf.StorageView, staticWALKey, &setCredentialsWAL{RoleName: "vault-readonlytest"}) - if walID != "" { + if walID != "" && err == nil { defer framework.DeleteWAL(ctx, conf.StorageView, walID) } switch { diff --git a/changelog/16686.txt b/changelog/16686.txt new file mode 100644 index 000000000..293eb7c61 --- /dev/null +++ b/changelog/16686.txt @@ -0,0 +1,3 @@ +```release-note:bug +secrets/database: Fix a bug where the secret engine would queue up a lot of WAL deletes during startup. +```