Repository navigation
Return fileservice read buffer allocation errors - #33129
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Queue requested — the merge queue status continues in this comment ↓. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 416f5765909c5a0eeee117eb480d11019608b98c
Assessment: approve
The patch returns ENOMEM before advancing the reader or completing the entry. LocalFS cleanup now clears the entry that owns a newly allocated buffer, and it publishes the resized caller buffer only after the read and conversion succeed. Disk cache read errors still allow fallback to the source.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
Validation:
-
Verified the clean frozen checkout, merge base, patch and whitespace, pinned policy, native inputs, and isolation preflight. Receipts and logs are matched in validation-reconciliation.json.
-
Ten focused Linux fileservice tests passed, including the ENOMEM and zero-allocation controls, LocalFS cleanup after a later entry fails, short reads, cache conversion errors, and cache read controls. See fileservice-check.jsonl and checks/1795497728038585101-2.json.
-
The frozen head records successful Ubuntu x86 unit tests, arm64 static analysis, and two multi-CN BVT jobs. The author reports same-head macOS arm64 build and QA coverage. All three discussion notices are accounted for.
Limitations:
- The focused tests exercise the affected reader, filesystem, and cache boundaries. The original Linux CN workload, mapping growth, and restart behavior were outside this validation.
🚫 Left the queue · pull request dequeued1 h 18 min in the queue, with no time running CI. So far
Reason Pull request #33129 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
To get back in the queue
Merge conditions not met when it left the queue
Tick the box to put this pull request back in the merge queue (same as
2 merge conditions met
Times in UTC · dashboard · how the merge queue works |
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: - #33095 ## What this PR does / why we need it: Fileservice panics when it needs a new read buffer and the allocator returns `ENOMEM`. Return the allocator error to the caller before reading or marking the entry complete. A read with sufficient existing capacity reuses that buffer without allocating. If a LocalFS read fails after allocating a new buffer, its rollback clears the owning entry and releases the buffer once. If the read reuses an existing buffer, LocalFS publishes the resized slice only after both the read and cache conversion succeed. Disk cache reads propagate ENOMEM to the caller before object-store fallback. Ordinary cache misses and read errors still fall back. When a later entry fails after a partial disk-cache hit, error cleanup clears the released buffer and its published reader so the same IOVector can be retried safely. ### Validation - Main baseline `e17d5541537d30252009a9a2d4c70ab5480d3bc3` (macOS arm64, Go 1.27.1). The issue's one-byte reproducer panicked after one allocation attempt when a buffer was needed. The existing-buffer case read the byte with zero allocations. The issue reports the same baseline behavior on `4.2-dev`. - Main candidate `be16d27be8fb21cd716620c4c7b86f1bc8e1f238` (macOS arm64, Go 1.27.1 with CGo). `make -j8 build`, the issue's reproducer, focused fileservice tests, QA probes, and changed-code lint passed. - `4.2-dev` candidate `fe121f6df07f1ac60826c5df1651c7ecbe108d96` (macOS arm64, Go 1.26.4 with CGo). Its branch-specific `make -j8 build` and the same reproducer, focused fileservice tests, QA probes, and changed-code lint passed. Both candidates returned an error matching `syscall.ENOMEM` after one allocation attempt, with the file offset unchanged and the entry incomplete. Both read the correct byte with zero allocations when capacity was sufficient. The QA probes also covered LocalFS rollback, short reads, conversion failures, and disk cache fallback. These are local results. PR CI runs separately. **Disk-cache follow-up at `8b85a3a815c3194c10697c96fe2613bdc68a62d1` (Darwin/arm64, Go 1.26.4, CGo)** - `TestS3FSReadDiskCacheAllocationFailure` reproduced the fallback allocation panic on `3cb144de818ec1ef25b9fd1b0de5859ace52eba8`. The repaired read returns ENOMEM without calling object storage or the cache-data allocator. The miss and short-read controls fetch the correct data, and the short-read buffer is released once. - Focused fileservice and ObjectIO cleanup tests passed with `-race -short -tags matrixone_test`. The fileservice package passed in the same mode with `TestMinioSDK` excluded because its external endpoint denied access in the earlier local run. Fileservice vet and incremental lint passed. - [CI on the preceding head](https://github.com/matrixorigin/matrixone/actions/runs/45322973397/attempts/2) passed. The injected test covers the fileservice path. The original Linux mapping exhaustion and CN restart behavior remain unverified. **Partial-hit cleanup at `762408a73d7d6d9975036fb8bdd5465d875ad90a` (Darwin/arm64, Go 1.26.4, CGo)** - The new `TestS3FSReadDiskCacheAllocationFailure` partial-hit case reproduced the stale owned buffer on the reviewed head. After the fix, cleanup clears the buffer and reader, and retrying the same vector reads both entries with fresh owned storage. The caller-buffer control retains and reuses its supplied capacity. - Focused fileservice and ObjectIO cleanup tests passed with `-race -short -tags matrixone_test`. The fileservice package passed in the same mode with `TestMinioSDK` excluded because its external endpoint denied access in an earlier local run. Fileservice vet and incremental lint passed. - [CI on the reviewed head](https://github.com/matrixorigin/matrixone/actions/runs/45390360095/attempts/2) passed. The local tests inject allocation failures. They do not reproduce the original Linux mapping exhaustion. ### Performance and deployment scope The read path adds a capacity branch and a publication check in LocalFS. The capacity-reuse tests confirmed zero allocations. The patch is expected to prevent the fileservice panic observed during the reported Linux CN checkpoint read when the allocator returns `ENOMEM`. The original CN workload, the mapping growth that reached the limit, and container restart behavior remain unverified by these tests. ### Related PR - Main implementation [#33129](#33129). Approved-by: fengttt <[email protected]> Approved-by: XuPeng-SH <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
Fileservice panics when it needs a new read buffer and the allocator returns
ENOMEM. Return the allocator error to the caller before reading or marking the entry complete. A read with sufficient existing capacity reuses that buffer without allocating.If a LocalFS read fails after allocating a new buffer, its rollback clears the owning entry and releases the buffer once. If the read reuses an existing buffer, LocalFS publishes the resized slice only after both the read and cache conversion succeed. Disk cache reads retain their existing fallback on errors.
Validation
e17d5541537d30252009a9a2d4c70ab5480d3bc3(macOS arm64, Go 1.27.1). The issue's one-byte reproducer panicked after one allocation attempt when a buffer was needed. The existing-buffer case read the byte with zero allocations. The issue reports the same baseline behavior on4.2-dev.be16d27be8fb21cd716620c4c7b86f1bc8e1f238(macOS arm64, Go 1.27.1 with CGo).make -j8 build, the issue's reproducer, focused fileservice tests, QA probes, and changed-code lint passed.4.2-devcandidatefe121f6df07f1ac60826c5df1651c7ecbe108d96(macOS arm64, Go 1.26.4 with CGo). Its branch-specificmake -j8 buildand the same reproducer, focused fileservice tests, QA probes, and changed-code lint passed.Both candidates returned an error matching
syscall.ENOMEMafter one allocation attempt, with the file offset unchanged and the entry incomplete. Both read the correct byte with zero allocations when capacity was sufficient. The QA probes also covered LocalFS rollback, short reads, conversion failures, and disk cache fallback. These are local results. PR CI runs separately.The current main PR head (
416f5765909c5a0eeee117eb480d11019608b98c, Go 1.27.1) and the current4.2-devPR head (3cb144de818ec1ef25b9fd1b0de5859ace52eba8, Go 1.26.4) each passedmake -j8 build,mo-service -version, the issue reproducer, the focused fileservice tests, and the QA probes on macOS arm64 with CGo.Performance and deployment scope
The read path adds a capacity branch and a publication check in LocalFS. The capacity-reuse tests confirmed zero allocations. The patch is expected to prevent the fileservice panic observed during the reported Linux CN checkpoint read when the allocator returns
ENOMEM. The original CN workload, the mapping growth that reached the limit, and container restart behavior remain unverified by these tests.Related PR
4.2-devbackport #33131.