Repository navigation
fix(health): keep files with unrepaired known holes degraded after a clean sweep - #1053
Open
firestaerter3 wants to merge 2 commits into
Open
firestaerter3 wants to merge 2 commits into
firestaerter3 wants to merge 2 commits into
Conversation
…clean sweep A hole padded during playback is persisted in the file's known_holes and the file is marked degraded. The next health check samples with STAT, and a provider can answer STAT for an article whose body is gone, so the sweep finds nothing missing. judgeValidation then returned file_healthy without looking at the hole map, and the file went back to healthy on the long schedule while the hole was still there. A clean sweep now checks the persisted holes. Holes not covered by a local PAR2 patch keep the file degraded (error type known_holes), which also queues PAR2 repair through the existing degraded path. The verdict is never failed, so the acceptable-missing threshold and the repair flow are unchanged. Holes count regardless of age or provider fingerprint: those only decide whether playback re-fetches before padding, and nothing in a STAT sweep can disprove a missing body. The patch-exclusion loop moves into a helper shared with classifyHoles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad file healthy Two gaps in the clean-sweep known-holes check: - It only looked for holes when prepareCheck had seen a non-empty hole map. Playback can record a hole while the STAT sweep runs, and that file was then still marked healthy. The verdict now always re-reads metadata on a clean sweep. That is one extra metadata read per clean check; health checks run per file on a schedule of hours to months, so the cost is small next to the network sweep itself. - A failed re-read was treated as "no holes", so a transient read error produced file_healthy. It now makes the check inconclusive, the same outcome as an unfinished STAT sweep: the prior status is kept, the next check is pushed out, and no retry is consumed. Metadata that is gone by the verdict is handled the same way; the next check's prepare step finds it missing and removes the record. An ineligible file whose metadata reads fine still becomes healthy as before. The content-verification tests built a checker without a metadata service; they now get one holding metadata for the files they judge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
@firestaerter3 test are failing can you fix it? |
This branch has not been deployed
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.
Fixes #1052
A clean health sweep marked a file
healthywithout looking at its persisted hole map, so a file that was zero-filled during playback went back tohealthywhile the holes were still there (details in the issue).Changes
judgeValidationnow reads the file's metadata again and checksknown_holes. Holes that no local PAR2 patch covers keep the filedegraded, with error typeknown_holes. This goes through the existing degraded handling, so PAR2 repair is queued as for any degraded file.failed. The acceptable-missing threshold and the repair flow are unchanged.healthy.healthyas before.classifyHoles.content_verify_test.goandcontent_verify_report_test.gonow give their checker a metadata service, since the clean path reads metadata.Known limits
known_holeswhen a later fetch of that article succeeds. So a file whose provider has refilled the article staysdegradeduntil PAR2 patches it or the record is reset. Removing a hole on a successful fetch would be a separate change innzbfilesystem.Testing
file_healthywithout the fix:CheckFileandCheckFilesBatch;healthy, and an ineligible file with a clean sweep stayshealthy.go vetandgo test -race ./internal/health/... ./internal/holes/... ./internal/metadata/...pass.