Skip to content

Commit

Permalink
secret/database: fix bug where too many wal deletes are deferred (#16686
Browse files Browse the repository at this point in the history
)

* 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>
  • Loading branch information
jasonodonnell and calvn committed Aug 11, 2022
1 parent b8a706b commit 1ef5211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/logical/database/rotation.go
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions 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.
```

0 comments on commit 1ef5211

Please sign in to comment.