[Store] Add put/get session APIs for ranged multi-buffer transfers#2881
[Store] Add put/get session APIs for ranged multi-buffer transfers#2881ascend-direct-dev wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces batch put and get session range APIs to support ranged reads and writes into multiple buffers using process-local sessions, optimizing data transfer by bypassing master RPCs. The review feedback identifies several critical issues that need to be addressed: an integer overflow vulnerability in submitRangeWrite during boundary checks, a concurrency bottleneck in RealClient::batch_put_start caused by executing network RPCs while holding a mutex, a lack of defensive checks against integer overflow in batch_get_into_multi_buffer_ranges, and potential out-of-bounds crashes in batch_put_end and batch_put_revoke due to unvalidated RPC response sizes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
dccf216 to
5020b99
Compare
545e20b to
74b0acf
Compare
|
Thanks for the RFC and prototype. I think the session-based ranged transfer direction makes sense for layerwise KV cache load/save, especially for avoiding repeated Master queries after One concern is that the new Relatedly, the PR currently introduces |
|
Thanks for the review — agreed on the direction. What we reused / aligned:
What we intentionally do not call into:
|
74b0acf to
28a89b3
Compare
Add session APIs so callers reserve/query once, transfer object-byte ranges across multiple buffers, then finalize—without re-querying Master on every range. - Get: batch_get_session_start → batch_get_into_multi_buffer_ranges → batch_get_session_end - Put: batch_put_session_start → batch_put_from_multi_buffer_ranges → batch_put_session_end / batch_put_session_revoke - get_sessions_ stores a FilterQueryResult'd QueryResult (single complete memory replica + lease); ranges use IsLeaseExpired locally (no Master) - Object-range overflow shares is_object_range_overflow with execute_ranged_read; transfer via Client::BatchTransferRead/WriteRanges → submitRangeRead/Write - Document session APIs in Mooncake Store Python API reference
28a89b3 to
347d413
Compare
Description
WIP: add put/get session APIs so callers can reserve/query once, transfer object-byte ranges across multiple buffers, then finalize—without re-querying Master on every layer.
Related RFC: #2887 (Layerwise KV Cache Session-Based Ranged Transfer for Mooncake Store)
batch_get_session_start→batch_get_into_multi_buffer_ranges→batch_get_session_endbatch_put_session_start→batch_put_from_multi_buffer_ranges→batch_put_session_end/batch_put_session_revokeQueryResultwith a single complete memory replica (FilterQueryResult); range paths only use the cache (no Master RPC)is_object_range_overflowwithexecute_ranged_readClient::StartBatchPut(same path asBatchPut); range transfers go throughClient::BatchTransferReadRanges/BatchTransferWriteRanges→submitRangeRead/submitRangeWriteModule
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
Test results:
RealClientTest.TestPutGetSessionRanges,TestPutGetSessionAbnormal,TestGetSessionLeaseExpiredDropsSession)session_ranges_tcp_e2e.pyPASSED)Checklist
./scripts/code_format.shpre-commit run --all-filesand all hooks passAI Assistance Disclosure
Cursor agent assisted implementation and local validation. The human submitter has reviewed every changed line and can defend the change end-to-end.