Repository navigation
Post-processing trusts live PAR's verified set: no second par verify, par2 index loaded once - #739
Merged
Merged
Conversation
xbmc4lyfe
force-pushed
the
live-par-trust-postproc
branch
3 times, most recently
from
November 27, 2026 01:27
ea31180 to
418981d
Compare
… par2 index loaded once The 6790 audit (finding 3) saw par-rename report every volume missing after live PAR had verified or repaired the whole set, request a par-check, verify every file again and log "Repair not needed" (1.0x the set re-read, most of the 26-50 s tail on damaged 4 GiB sets). Cause: par-rename is handed the first-16-KiB MD5 the download computed for each file, but the queue stores it printed the nzbget way (bytes last to first). It was parsed in digest order, so every known hash was reversed and matched nothing: every file was "missing", on clean sets too (6790 job 3102). parrenamer::parse_printed_hash16k reads it back in digest order. Then, when live PAR has a complete verified state of the set, the par-check is not run: parchecker::streaming_session_verified_cover requires a current session on the download folder with trusted slices, every slice verified (or rebuilt and verified, rechecks done), none diverged, no fold pending, no file outside the recovery set, every file under its par2 name at its par2 length, the queue file whose bytes live PAR verified, and unchanged since post-processing first looked (inode, length, mtime). prepost takes it where the par-check would start (ParCheck=auto, health below 100% or a requested check; never after an unpack, for a forced check or repair, or a post-process again) and stores what nzbget stores after a quick par-check that needed no repair (ParStatus SUCCESS, par_full 0), erasing the stream-repair jobs of the verified files. Otherwise the normal par-check runs and the detail log says why. Post-processing now loads the par2 index once (par-rename); the par-check loaded the index and every recovery volume again. Harness: liveparrarclean, liveparrartrust (RAR set, production options, live PAR; damaged set with lost and corrupt articles) assert no par-check lines, no missing volumes, one par2 load and nzbget's statuses; liveparraroff is the control with live PAR off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gYUGuwLMB2hw7HQGbM
xbmc4lyfe
force-pushed
the
live-par-trust-postproc
branch
from
November 27, 2026 01:55
418981d to
4b3f599
Compare
xbmc4lyfe
marked this pull request as ready for review
November 27, 2026 02:05
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
xbmc4lyfe
added a commit
that referenced
this pull request
Nov 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gYUGuwLMB2hw7HQGbM
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
6790 audit (prybar rgstream report) finding 3 and finding 7: after live PAR has verified or repaired the whole set, post-processing still ran a full par verify, and loaded the par2 index again and again.
Cause. Par-rename is handed the first-16-KiB MD5 that the download computed for each file. The queue stores that hash nzbget-style: the bytes in reverse order, as upper-case hex. It was parsed as if it were in digest order, so every known hash was reversed and matched nothing. Par-rename then reported every file "missing" and requested a par-check, on clean sets too (6790 job 3102, harness repro on main).
parrenamer::parse_printed_hash16kreads it back in digest order.Trust live PAR. Post-processing now skips the par-check when live PAR has a complete verified state. That needs all of the following:
When all of that holds, the job gets what nzbget stores after a quick par-check that needed no repair: ParStatus SUCCESS and par_full 0. The stream-repair jobs of the verified files are erased, as
register_verified_filedoes. If any condition fails, the normal par-check runs and the detail log says why.Par2 index. Post-processing now loads the par2 index once, in par-rename. The par-check used to load the index and every recovery volume again.
Tests
parchecker/live_trust_tests.rs): the cover needs every slice verified, ends when a file changes (another inode, or a shorter file), needs trusted slices and a current session, and needs the file live PAR verified (binding cases). Alsoparrenamer::printed_hash16k_reads_back_in_digest_order.liveparrarclean: no par-check, no missing volumes, one par2 load, ParStatus NONE.liveparrartrust: lost and corrupt articles, direct unpack stops, live repair at download end. No par-check lines, no missing volumes, one par2 load, the trust line, SUCCESS / ParStatus SUCCESS / UnpackStatus SUCCESS, byte-exact.liveparraroff(control): the same damaged set with live PAR off. The par-check runs and is seen (Verifying lines, at least 2 par2 loads, "Successfully repaired"), with the same statuses.Validation
Final head 4b3f599, on main 2321559. The range-diff against 418981d and ea31180 is "=". GitHub Actions is unavailable, so the farm runs replace it.
Farm job for 4b3f599:
macOS (m5air, same patch at 418981d): cargo_exit=0. The rest of that run was still queued when this was merged. macOS is not in the merge gate for this change: it has no platform-specific code beyond the existing cfg(unix) FileStamp.
Earlier heads:
Head 418981d, on main 3471984. GitHub Actions is unavailable, so the farm runs replace it.
Farm job farm-val-418981d0-1795742840dpch:
The same patch on f1be381 (head ea31180; range-diff "=") had no failures:
Earlier head 6e64b1c on m5air: cargo_exit=0 (1602 passed), daemon_exit=0.
Deployed on 6790
rustyget_0.1.0+git20261127004343.eac9eba6_amd64.deb, sha256 5dbb5e24a5793b764c16d63d3100ac4a9c4cd0dcac58ffffc25e0bc3e6dac5be.cmpequal, 187 Server lines).server:~/rgtest/lpt/run-before-20261127T011431Zandrun-after-20261127T010129Z.Follow-up (not in this PR)
Live PAR's
live_hash16kcallers also receive the queue's printed hash: articledl.rs 832/843/2210/2594/2723 and queuecoord.rs 3704/4026/4057. Hash-based binding there never matches, andbind()may invalidate the namespace on renamed sets. The trust decision here rests on per-slice par2 checksums, not on those hashes.Review
rebuilt_filesis not empty. Both were fixed in ea31180, and its delta review is G2G.🤖 Generated with Claude Code
https://claude.ai/code/session_01LG44gYUGuwLMB2hw7HQGbM