feat: manage backup retention in Klio instead of Kopia - #238
Open
gabriele-wolfox wants to merge 2 commits into
Open
feat: manage backup retention in Klio instead of Kopia#238gabriele-wolfox wants to merge 2 commits into
gabriele-wolfox wants to merge 2 commits into
Conversation
gabriele-wolfox
force-pushed
the
dev/168
branch
3 times, most recently
from
September 7, 2026 15:35
ec38630 to
5972f01
Compare
Replace Kopia's snapshot-expire retention with a Klio-managed policy manager that evaluates the backup catalog and deletes the expired backups itself. The only criterion for now is latest, which keeps the N most recent backups; it is configured per tier in the PluginConfiguration and must be at least 1. Because retention no longer runs through Kopia, the tier2 snapshot pins are gone. The invariant that a tier1 backup is never deleted before it reaches tier2 now lives in the retention selection, read from our own catalog, which keeps snapshot manifest IDs stable. The tier1 and tier2 policies travel to the server on the CloseBackup request, and the consumer applies them per tier after every backup. The klio retention CLI and the Kopia policy plumbing are removed. Assisted-by: Claude Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
Add a klio retention apply command and an ApplyRetention gRPC call that apply the configured retention immediately, without waiting for the next backup. This frees space on demand, for example after shrinking the policy on a nearly-full disk. The command reads the client configuration and sends the tier1 and tier2 policies to the server, which enqueues a maintenance-only task. The backup consumer then runs the same per-tier retention path used after a backup, so there is a single retention implementation. Assisted-by: Claude Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
gabriele-wolfox
force-pushed
the
dev/168
branch
from
September 8, 2026 07:30
5972f01 to
c1def0c
Compare
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.
Replace Kopia's snapshot-expire retention with a retention policy manager that Klio owns: Klio evaluates its own backup catalog and deletes the expired backups, rather than delegating to
kopia snapshot expire.Highlights
retentionPolicyin thePluginConfigurationwith a singlelatestcriterion (keep the N most recent backups), configurable per tier and validated to be at least 1. Omitting it keeps every backup.CloseBackuprequest and is applied per tier by the backup consumer after every backup.klio retention applycommand (andApplyRetentiongRPC call) to apply the configured retention on demand (eg. without waiting for the next backup, to reclaim space quickly after tightening the policy).klio retention set/getCLI and the Kopia retention-policy plumbing are removed.Testing
The tier2 retention e2e now exercises both automatic retention (three backups, keep two, verify the oldest is deleted) and the on-demand command (tighten to one, run
klio retention apply, verify only thenewest remains).
Closes #168.