fix(sync): the background whole-store sync must not log a download it never stored - #468
Merged
Conversation
… never stored The whole-store sync emitted an info-level "downloaded a capsule" line as soon as the bytes arrived -- before the chain-anchored verify, the provenance marker and the atomic write, any of which can refuse. The background wrapper then collapsed the resulting Err to a bare false and logged nothing, so on a headless node the only trace of a sync that stored nothing was a line saying it had downloaded one. The pre-store line now states the fact it actually has (bytes received, verifying and storing), a new line reports residency only once write_atomic has published, and the background wrapper names its failure in the control verb's own wording. Closes #341
Contributor
Author
|
Re-ran the full suite on the reclaimed disk: This supersedes the |
# Conflicts: # Cargo.lock # Cargo.toml
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.
What this changes
Closes #341.
The background whole-store sync path emits
info!("whole-store sync downloaded a capsule")before the chain-anchored verification, the provenance marker, and the atomic write. Every one of
those can refuse, and the background caller (
sync_module) maps the resultingErrto a barefalsewith no line of its own — so on a headless node the only log evidence of a sync that stored nothing
is a line saying it downloaded a capsule.
Observed on a real two-host EC2 run (
mvp4-20260824-160219, v0.145.0 from the released.deb).Blast radius checked
gitnexus indexes for this repo are ~300 commits stale (CLAUDE.md §2.0 records that a stale index returns
a false-safe
impactedCount: 0), so the radius was taken by grep + direct read and is stated as such.sync_module_fromcallers:sync_module(lib.rs:2410) and in-crate tests only. No cross-crate caller.mirror/*,spend_audit.rs,server.rs,download.rs,dispatch.rs,content_serve.rs,peer.rs,admission.rs,conduct.rs,dig-wallet/src/sage/*all untouched).Status
DRAFT — the gate round has not returned.
Evidence
Two tests read a scoped capturing subscriber's REAL emitted records — not that the failure path is
reachable, which was never the defect.
test result: ok. 2 passed; 0 failed(count read, not exit status).Each part proven load-bearing by reverting only that part on a committed tree:
1 passed; 1 failedwarn!and the "stored" wording0 passed; 2 failedThe fixture makes the download genuinely SUCCEED and the chain disagree, because a wire failure would
never reach the log statement at all — that is the shape actually observed on the EC2 run.
The control test (
a_background_sync_that_stored_a_capsule_says_so) exists to reject the wrong fix:deleting the line would satisfy every negative assertion while removing the operator's only
confirmation that a capsule is resident.
Stated rather than implied: the full
dig-node-corelib run was1006 passed; 26 failed, and all26 failed with
Io(Os { code: 112, kind: StorageFull })from the fixture compiler — the dev machine isat 3.4 GB free of 1.9 TB. Unrelated to this diff and not reproducible until disk is reclaimed.