Repository navigation
Conversation
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6810f3d4ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| val matches = verification.verify() | ||
| // A previous canceled/failed write may have left bytes without a completed flush. | ||
| if (matches) handle.flush() |
There was a problem hiding this comment.
Flush each file once rather than after every valid piece
For a valid multi-piece file, this invokes a durable filesystem flush for every piece; the platform implementations map this to FileChannel.force(true)/fsync. With the accepted 16 KiB minimum piece size and up to 1,000,000 pieces, a normal recheck can therefore perform hundreds of thousands of expensive flushes even though it writes no data, making restart verification impractically slow. Track which files contain matching data and flush each file once after scanning it instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e69f761. Recheck now scans each selected file through one handle and flushes once for its matching pieces. Bitmap changes stay tentative under the mutex until that flush and the cancellation boundary succeed; failure clears the file’s tentative bits before unlocking. The new four-piece regression asserts exactly one flush and verifies that an injected flush failure publishes no pieces or progress. All five focused recheck tests pass, including the blocked-provider cancellation test.
|
Superseded by #233 (V2 layout and verified storage) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
Add authenticated reads and bounded rechecks to the v2/hybrid store. Reads require committed availability, validate the owned file and payload snapshot again, and transfer a buffer reservation to the consumer until it closes the result. Changed, truncated or replaced files revoke the affected availability without exposing their bytes.
Rechecks discard prior progress, verify selected owned files with at most 64 KiB of payload scratch, flush matching bytes and publish progress only after the I/O cancellation boundary. Cancellation retains active I/O reservations until the provider returns; a later scan can recover valid data.
Stack: based on #178, advancing #162 step 06. This still operates on the live fresh-directory store; restart/import ownership, checkpoint v2, session integration and wire proof serving remain pending.
Validation: all 366 local torrent tests, both existing pinned-client v1 conformance scenarios and the native-runtime guard pass. New tests cover consumer-held read budgets, uncommitted reads, corruption, truncation, foreign replacement preservation, scratch-space limits and canceled blocked rechecks.