mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4883] [Bug]: Direct NVMe-oF requests past segment end can report partial I/O as COMPLETED #1242
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#1242
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RuiqingFeng on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4883
Environment and affected path
Mooncake upstream main
c67a88f381(2026-10-23). This concerns the classic Transfer Engine's direct
NVMeoFTransport::submitTransfer(batch_id, entries) path, not Store's SPDK
NoF path or NVMe KV backend. The MultiTransport task-batch path is a
separate, explicitly unsupported interface for this transport.
Reproduction
Create an NVMe-oF segment with two 4096-byte buffers. Allocate a direct
transport batch and submit a WRITE with target_offset=4096 and length=8192.
The segment is only 8192 bytes long, so half the request lies outside it.
Observed with the real transport and descriptor-pool sources linked to fake
cuFile entry points on Linux (GCC 13.3, C++20):
with transferred_bytes=4096, although requested_bytes=8192.
also mutates the batch and submits I/O instead of rejecting the call.
The fake backend records submitted cuFile parameters and completes exactly
those operations; no real GPU, NVMe device, or storage DMA was exercised.
Two legal single-/cross-buffer control cases pass on the same baseline.
Expected behavior
Reject a request that is not fully covered by the segment with
InvalidArgument before creating any tasks, slices, file handles, or I/O
parameters for that submission. Check every request before mutating the
batch, retain any existing tasks, and permit a subsequent valid submission.
Use overflow-safe arithmetic for the segment length and request range.
This is validation atomicity, not transactional I/O after successful submit.
Cause
submitTransfer intersects each request with nvmeof_buffers and only submits
those intersections. It never verifies that the requested interval is fully
covered. aggregateTransferStatus only aggregates submitted slices, so it
cannot detect bytes that were omitted before submission. The request-end
addition and cumulative buffer lengths are also unchecked.
Related work and proposed fix
I searched upstream issues and PRs using the authenticated GitHub API.
#2893 and #2939 address task submission/completion correlation and terminal
failure propagation. Open PR #2917 changes cancellation/draining and
submission-error rollback; its submitTransfer diff still uses the existing
intersection-only slicing without full request-range validation. This report
covers pre-submission range validation, not that lifecycle work.
I have prepared a focused fix and regression tests for full-range
prevalidation, integer overflow, mixed-validity submissions, retry and
existing-task preservation. I would like to contribute the fix.
AI assistance
Codex assisted with investigation, implementation and test preparation.
@github-actions[bot] commented on GitHub (Oct 23, 2026):
Thanks for opening this issue, @RuiqingFeng!
293799895A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide