Repository navigation
fix(wpm): bound the rollback copies and let wpm clean reclaim them - #1210
Merged
Merged
Conversation
caomengxuan666
force-pushed
the
fix/backup-retention
branch
from
October 17, 2026 06:07
c4fdca4 to
5098be5
Compare
Every self-update writes `backup/winuxcmd-before-update-<pid>.exe` and nothing ever pruned them, so a machine that has taken a handful of updates carries every image it has ever run - 61.8 MB of rollback copies on the machine where this was measured, growing silently and never surfaced by any command (#1208). - `prune_update_backups(root, 2)` runs before each update writes its own copy, ordered by write time (the names carry a pid, not a timestamp), so the newest two rollback images survive and older ones go. Best effort: an image another process holds stays rather than failing the update. - `wpm clean backup` removes them on demand and `wpm clean all` now includes them - that is the command a user types when reclaiming space. - The guide documents both, and says how many the update keeps. Test: `wpm.clean_backup_removes_rollback_copies` (the target removes the copies and leaves the index alone; `clean all` takes the directory too). `wpm.*` 61/61.
caomengxuan666
force-pushed
the
fix/backup-retention
branch
from
October 17, 2026 06:57
5098be5 to
3caa407
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.
Closes the retention half of #1208; the live verification of the automatic prune follows the next release (the prune runs inside the self-update helper, which is the downloaded binary — see the second commit of #1209 for why that path is now logged).
Why
Every
wpm update winuxcmdwritesbackup/winuxcmd-before-update-<pid>.exe, and nothing ever pruned them. On the machine where this was measured.wpm\backupheld 61.8 MB of rollback copies — every image that machine had ever run — and no command surfaced or reclaimed it (wpm cleancoveredcacheandstagingonly). Related and the same shape: the niubash install directory carries fiveniu.exe.*copies (54.5 MB).What changes
prune_update_backups(root, 2)runs before each update writes its own copy. Ordered by write time (the file names carry a pid, not a timestamp, so sorting by name would be wrong), the newest two survive. Best effort: an image another process holds is left rather than failing the update.wpm clean backupremoves them on demand, andwpm clean allnow includes them — that is the command a user types when reclaiming space.Verification
wpm.clean_backup_removes_rollback_copies:clean backupremoves the copies and leaves.wpm/indexesuntouched; after a new copy appears,clean alltakes the directory as well.wpm.*61/61.Not here
niu.exe.*accumulation is the same defect in another repository; reported in self-update backups accumulate without bound (.wpm/backup = 61.8 MB) #1208 rather than fixed here.wpm cleanstill reports bytes but not the per-directory split; not needed for this.