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. +```