Skip to content

fix(fileservice): zero-fill gaps in write entries on 4.2 - #32779

Merged
XuPeng-SH merged 1 commit into
4.2-devfrom
codex/io-entry-gap-gap-42-20261116
Nov 15, 2026
Merged

XuPeng-SH merged 1 commit into
4.2-devfrom
codex/io-entry-gap-gap-42-20261116

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG

Which issue(s) this PR fixes:

Related to #32777. This is the separate 4.2-dev counterpart of the main fix.

What this PR does / why we need it:

FileService's IOEntry.Offset contract says that gaps in a write are zero-filled. The entry reader previously advanced past the gap without initializing the returned bytes, so the result depended on the supplied read buffer. Clear exactly the gap portion before advancing; contiguous input keeps its existing path.

Validation on CPU-only Linux with Go 1.26.4:

  • The regression test fails on the unmodified 4.2-dev base and passes with this change. It covers prefix and internal gaps across multiple read sizes, untouched bytes beyond the returned length, and a contiguous control.
  • Known-size and unknown-size one-shot stream inputs, and MemoryFS / LocalFS2 write-read cases, pass.
  • The selected reader and file-service tests passed 10 repetitions under race; make static-check-selected STATIC_CHECK_PACKAGES=./pkg/fileservice passed. The full fileservice package suite was not run.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner November 15, 2026 18:37
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify

mergify Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: e1398a68ef92703304edaf67f7095367da3ef782

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: e1398a68ef92703304edaf67f7095367da3ef782

Assessment: approve

The 4.2 backport restores the existing zero-fill contract by clearing only returned gap bytes in the shared reader. It covers all four writer consumers without new state or backend-specific logic. No actionable correctness or design findings remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Reviewed the complete delta, four write consumers, linked issue #32777 and all three discussion entries; saved plan, change map and discussion ledger.

  • Go1.26.4 focused reader, stream and backend tests passed. The base-reader control fails all four poisoned-gap cases while contiguous controls pass.

  • Owning package: 332 top-level passes, six skips and one Minio credential failure. The same constructor failure reproduces with the base reader; affected FileService cases pass with explicit fixture credentials.

  • Repository-pinned golangci-lint and molint checks passed, together with formatting, diff, clean-source and native loader audits.

  • validation-evidence.json reconciles all 14 terminal check-run receipts with commands, source fingerprints and retained logs.

Limitations:

  • The initial full-package command remains failed; recovery reran only the affected Minio FileService cases. Six existing tests were skipped.

  • The frozen snapshot still had shared build, Go analysis, x86 UT, arm64 SCA and coverage CI pending; these were not counted as passes.

This branch was previously deployed

1 inactive deployment
ci — e1398a68 Deployed Nov 15, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants