Repository navigation
export.json records the effective size; recovery reconciles a size mismatch - #105
Merged
Merged
Conversation
…he manifest's size
A fork is at least as large as its base whatever size_gb asked for, but
export.json recorded the request. On recovery the cache was opened at the
smaller size and refused ("Cannot shrink device", Cache(InvalidMetadata)),
so the export was left out of the successor router: every restart and
graceful handoff of such an export aborted with ExportMismatch (homelab:
two rootfs-cache staging exports, 4 GiB recorded, 16 GiB real).
PUT /api/exports now saves the handler's real size, and the recovery path
takes max(export.json, persisted manifest size) before opening the cache.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XoaQgogNq1z3dNoM9feGoH
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.
Homelab GlideFS handoff (v0.9.6 upgrade and a same-binary dry run) aborts with
ExportMismatch: the successor cannot restore tworootfs-cache.bases-ubuntu-noble-16g.*exports. Journal:Cannot shrink device stored_size=17179869184 config_size=4294967296thenFailed to restore export ...: Invalid cache metadata(cli/server.rsrecovery,write_cache/inner.rsshrink check). S3export.jsonsaidsize_gb: 4.0; the live device is 16 GiB because a fork is at least as large as its base (router.rscreate_export fork path). Any restart or handoff of such an export fails.Fix
PUT /api/exportssaves the handler's real size inexport.json(api.rs).max(export.json, manifest size)(router.rscreate_export, normal path; the manifest is fetched once, as before). So existingexport.jsonfiles that still record the request recover too: no deletion, no migration.Proof
test_fork_smaller_than_base_records_effective_size_and_recovers(hermetic): fork a 0.1 GB image atsize_gb0.01; assert export.json records 0.1; rewrite it to the legacy 0.01, shut the router down, build a second router on the same store and cache dir, and recover (what the successor does in a handoff).0.01); with that assertion disabled, FAILED at recovery withCache(InvalidMetadata), the production error.cargo test -p glidefs --features ublk --lib -- block::api block::router: 125 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01XoaQgogNq1z3dNoM9feGoH