Skip to content

par-rs 985b373: back-fill waits for slices not on disk; spare slots in one pass - #743

Draft
xbmc4lyfe wants to merge 3 commits into
live-par-handoverfrom
par-rs-985b373
Draft

xbmc4lyfe wants to merge 3 commits into
live-par-handoverfrom
par-rs-985b373

Conversation

@xbmc4lyfe

@xbmc4lyfe xbmc4lyfe commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

What

Bumps zipfast to main 01dadb54 (#314 DeclaredBad holes, #315 1 TiB byte-total defaults, #312 RAR5 -m3 speed, #310 damaged-input salvage, #307, #308). Direct unpack also stops re-extracting a set after a bad part.

prybar's 4 GiB live-path audit found 1.3-3.9 GB of re-reads. They came from a corrupt article whose yEnc CRC was valid. A stored part failed its own check and the persistent session ended (fixed in zipfast #314). RustyGet then dropped the partial state and extracted again from volume 1, and post-processing extracted everything a third time.

  • DeclaredBad holes (progressive_unpack/persistent.rs hold_declared): the volume was handed out whole, so it is now held as damaged through the new VolumeFeed::declare_damaged. That also works after the download ended: post-processing repairs first, then resumes. The hole is refilled only from the repaired file.
  • Verify failures (Verdict::PartBad / Bad on plain members): PartialFile::declare_hole on the volume(s), wait for the repair, refill_from_packed (reads only the holes), then verify once more. This replaces Step::Fallback + remove_state_root + full re-extraction. A second failure fails the job as damaged. Encrypted members keep the old fallback, because a keyed check failure may be a wrong password.
  • Live PAR bad slices (parchecker.rs): slices that turn Damaged on an article that arrived whole are recorded. Direct unpack takes them once their file is complete and the damage has lasted 10 s. It declares them holes of the session (session.declare_hole, data only, placed with place_holes), so zipfast never reads them and the refill reads only the slice.
  • Hold lifecycle (postproc.rs):
    • A declared hold releases itself once live PAR has verified the declared ranges on disk. The slices must not be diverged, and the file must be complete with no recheck pending.
    • When the download ends with a declared hold, post-processing repairs first. The resume then needs a real repair (prepost.rs): health 100% is not proof.
    • Once post-processing has resumed direct unpack, a new declaration reads the repaired volume back at once instead of holding it.
    • Declared holds are saved for a restart (record_damaged).
  • Post-processing: par's extra-file scan skips .rustyget-partial, so it no longer reads the extracted partial outputs again. With direct unpack succeeding, post-processing does not unpack again; the scenarios below assert this.
  • damaged_input: not used. RustyGet runs no RarSession, and progressive/persistent sessions refuse damaged headers whatever the option says (zipfast refactor(rpc): port XmlCommand append/feed/testserver parameter parsing to Rust (batch 187) #310 docs). Revisit when zipfast adds it to the progressive sessions.

Not done here (follow-up): par still reads the .rustyget-deadvol-*.data stand-in. It may need those bytes to repair a dead volume, so excluding it needs its own check.

Tests

  • Unit (progressive_unpack/tests.rs):
    • a part failing its own check waits for the repair and is not extracted again;
    • with no repair possible, it is never refilled from the unrepaired file;
    • a live-PAR bad slice is never read and only it is refilled.
  • Unit (postproc.rs): a declared hold until the resume, not after.
  • Harness: corruptpartdu (RAR4 stored) and corruptpartdurar5 (RAR5 stored). Each is an 8 x 1 MB set with one wrong byte in volume 4, posted with valid yEnc CRCs and par2 with 20 recovery blocks. Each asserts:
    • SUCCESS, byte-exact output, direct unpack successful;
    • volume 1 extracted once, no progressive fallback, no "unpacking all files again";
    • extraction wrote at most the set, and refills read at most one part plus two slices.

RESULTS_PLACEHOLDER

🤖 Generated with Claude Code

https://claude.ai/code/session_01LG44gYUGuwLMB2hw7HQGbM

xbmc4lyfe and others added 3 commits November 26, 2026 17:24
…n one pass

par-rs 2524277..985b373: #146 whole-file MD5 off the critical path, #147 a
mid-download slot add also allocates spare slots in the same back-fill pass
(on all cores), a slice not on disk yet leaves the back-fill pending
(needs_backfill) instead of returning Err, CountedFile reads with pread.

The back-fill thread now counts a pass done only when nothing is left
pending, so the retry delay stays in force while slices wait for the cache.

Tests: an article taken as written before its write lands is never damaged
(the staged check after the flush verifies it); an unplanned volume mid-
download costs one back-fill pass and later volumes land in spares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gYUGuwLMB2hw7HQGbM
…e spare-slot test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gYUGuwLMB2hw7HQGbM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant