Repository navigation
feat: add bounded PostgreSQL workflow history retention - #6961
Open
Danny5487401 wants to merge 1 commit into
Open
Danny5487401 wants to merge 1 commit into
Danny5487401 wants to merge 1 commit into
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6942
Related: #6959
Problem and behavior
Self-hosted PostgreSQL installations can exhaust storage on workflow execution results/TOAST and execution logs. This adds an opt-in maintenance CLI that defaults to a consistent, read-only preview and requires explicit tenant scope and
--applybefore deleting history. No retention task is automatically scheduled.python -m keep.cli.workflow_retention \ --tenant-id TENANT_ID \ --success-retention-days 14 \ --failure-retention-days 30 \ --success-log-retention-days 7 # Inspect the complete preview, then rerun with --apply if appropriate.The implementation follows the maintenance-script approach discussed in #6959, with these safeguards:
Validation
Rollout notes
Existing large installations should inspect free space and prebuild the documented index before upgrading, so API startup does not wait for a long index build. Cleanup performs no DDL or VACUUM. The documentation covers backups/restoration, bounded catch-up, single-process scheduling, ordinary VACUUM/autovacuum, and why deleted storage does not necessarily immediately reduce filesystem usage.
Reducing newly persisted intermediate step outputs remains a separate follow-up; this PR does not truncate or rewrite successful checkpoints.