Skip to content

fix(fileservice): zero-fill gaps in write entries - #32778

Merged
XuPeng-SH merged 2 commits into
mainfrom
codex/io-entry-gap-gap-main-20261116
Nov 15, 2026
Merged

XuPeng-SH merged 2 commits into
mainfrom
codex/io-entry-gap-gap-main-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. A separate 4.2-dev change is needed as well.

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.27.1:

  • The regression test fails on the unmodified 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.

@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.

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Nov 15, 2026
@XuPeng-SH

XuPeng-SH commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 084ef60cbae712079a241f76fe1750850a51c2f7

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: 084ef60cbae712079a241f76fe1750850a51c2f7

Assessment: approve

The shared write-entry reader now initializes exactly the gap bytes it returns, restoring the existing zero-fill contract without new state or backend-specific mechanisms. No actionable correctness or design defects remain.

Model: gpt-6.1-sol / max

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

Validation:

  • Read both changed files, the linked issue and all three discussion entries; saved review-plan.md, change-map.json and discussion-assessment.json.

  • Fresh focused tests passed, including both stream modes and MemoryFS/LocalFS2 roundtrips. The exact-base reader control fails all four poisoned-buffer gap cases while contiguous controls pass.

  • Full fileservice package passed normally: 717 top-level passes, six skips, 298.149s.

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

  • validation-evidence.json maps commands, frozen source, exits and retained logs to check-run receipts.

Limitations:

  • Six existing package tests were skipped; details remain in package-tests.log.

  • The supplied CI snapshot still had broader UT/SCA/coverage/BVT checks pending; those were not counted as passes.

This branch was successfully deployed

No deployments
ci — a40b3624 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