Repository navigation
Offload: ship only what changed; stop failing (and re-shipping) the same folders daily - #7
Merged
Merged
Conversation
…ery day
The guard re-shipped the same folders every day because their shipments
failed, so they were never deleted, and each retry wrote a full new dated
snapshot (about 12 GB a day for moveweight-ui). That filled /opt/repos.
* Change detection: every part (git-state, bundle, patch, untracked or
folder tar) is fingerprinted locally before anything travels: refs for
the bundle, the diff for the patch, path+size+mtime for tars. A folder
exactly as it was at its last verified shipment ships nothing. An
unchanged part of a changed folder is pointed at (PARTS.json, RESTORE.md)
instead of sent again. State lives in offload-sent.json, and a part
missing from the server is shipped again.
* Count mismatch ("52185 untracked files packed, 52175 arrived"): tar
--exclude drops any path with a rebuildable component
(.pytest_cache/README.md, node_modules.partial/x/coverage/...), but MWM
listed and counted them.
* "tar.exe: Error exit delayed from previous errors" (infernal-arcforge): a
junction into a drive that is gone made tar fail after writing the whole
archive, every day, leaving untracked.tar.gz.part at the same size.
Dangling links are now left out and listed in RESTORE.md, and tool
errors report the real lines instead of the last one.
* A pruned worktree (gitdir gone) ships as a plain folder instead of
failing every git command.
* A failed shipment removes its own folder from the server, so no .part
files are left behind. A second run on the same day gets its own folder.
* "Shipped but the delete failed" is reported as that, with the cause, and
the next run only retries the delete.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
On 2026-10-26,
/opt/repos(728 GB) on the server filled to 0 bytes.mwm-offload/5050rtx/held up to 19 dated copies of the same folders.moveweight-uialone was about 12 GB per copy, and consecutive days were byte-identical.The guard log shows the cause. The data rarely changed, but every shipment of these folders failed. Each failure kept the local folder, so the next day the guard shipped the whole thing again into a new
YYYYMMDD-<name>folder. It left a full or partial copy behind every time and never wrote aRESTORE.md:52185 untracked files packed, 52175 arrived.pytest_cache/. tar's--exclude .pytest_cachematches any path component, but MWM listed and counted them.26473 … packed, 26460 arrivednode_modules.partial/stream-buffers/coverage/.tar.exe: Error exit delayed from previous errorspublic/cr-realmsis a junction toD:\codex-build-spill\…, which no longer exists. See below.fatal: gitfile does not point to a valid repository.git/worktrees/<name>is gone) was still treated as a worktree.delete C:\MoveWeight\romm\RommForXboxThe ".part that stalls at 1,802,373,000 bytes"
It was not a stall. That file is the complete archive: the gzip stream is intact (
gzip -tpasses, and the tar inside ends cleanly), and 3.08 GB of tar compresses to 1.80 GB. Windowstar.exewrote the whole archive, then exited 1 because it could not stat the dangling junctionpublic/cr-realms. MWM bailed before the checksum and rename, sountracked.tar.gz.partstayed behind. Its size was the same each day because the content was the same. MWM only reported tar's last stderr line, so the cause never showed. Reproduced locally (output piped towc -c):What changes
Change detection. Before anything travels, every part is fingerprinted locally:
git-state.json: its bytes.unpushed.bundle: the refs it starts at and the remote refs it stops at.uncommitted.patch: the diff, hashed as it streams.untracked.tar.gz/folder.tar.gz: every path, size and mtime.If a folder is exactly as it was at its last verified shipment, nothing is shipped. If only some parts changed, the changed parts ship and the unchanged ones are pointed at in
PARTS.jsonandRESTORE.md, which give each part's real server path. State lives in%LOCALAPPDATA%\MoveWeight\MWM\offload-sent.json. Before a part is reused, its file is checked on the server by size, and a part that has gone missing is shipped again.Count fix.
is_rebuildablenow matches any path component, as tar does. Untracked files inside a rebuildable folder are dropped, and the newmanifest()counts exactly what tar keeps.Dangling links (symlinks or junctions whose target is gone) are left out of the tar list and listed in RESTORE.md as
path -> target.Readable errors. Tool errors report the real stderr lines; tar's "Error exit delayed" line is dropped. The guard log shows the whole error chain (
{e:#}), so a failed delete now says why.Pruned worktrees ship as plain folders.
No more
.partlitter. A failed shipment removes the folder it created on the server and says so in the log. The local folder is untouched, so nothing is lost. A second run on the same day gets its ownYYYYMMDD-<name>-HHMMSSfolder and never writes into the first one.Shipped but the delete failed is reported as that. The shipment stays recorded, so the next run only retries the delete instead of shipping again.
Tests
11 new unit tests:
statparsing1 end-to-end test (
#[ignore], opt-in) that ships a scratch repo over real SSH four times: a full ship; an unchanged ship (nothing travels, same folder); one changed part (onlyuntracked.tar.gzandgit-state.jsontravel, and RESTORE points at the earlier bundle and patch); and a part deleted on the server (it is shipped again). Run it withMWM_TEST_SERVER=root@127.0.0.1 cargo test -p mwm-core offload -- --ignoredon a box that can SSH to itself.Results:
cargo test -p mwm-core --lib offload: 13/13 passed.cargo test -p mwm-core --libon CT 190: 48 passed, 1 ignored.cargo tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --no-bundle): succeeded,MoveWeightManager.exe(7.8 MB), with no warnings fromoffload.rs.The installed guard was not updated: deploying is a separate step.
Before deploying, note
The count, junction and worktree fixes will let the guard's next run actually move moveweight-ui, cryptic-realm-mobile-color-fix, cryptic-realm-infernal-arcforge and cr-parent off C: and delete them locally, after a verified shipment, as the policy says (
idleDays: 2). The files that are left out are rebuildable caches (.pytest_cache,coverage) and the danglingpublic/cr-realmsjunction, whose target is already gone; RESTORE.md records it.Server side, outside this repo:
mwm-offload/dedupe-identical.shnow skips any snapshot that a newerPARTS.jsonpoints into. The previous version is kept asdedupe-identical.sh.bak-20261026.🤖 Generated with Claude Code