[PR #1347] [MERGED] [Store][Feature]Introduce DataManager for unified local + remote data access #2182

Closed
opened 2026-10-29 21:33:24 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1347
Author: @swallowCXY
Created: 1/9/2026
Status: ✅ Merged
Merged: 1/16/2026
Merged by: @wanyue-wy

Base: P2P-Mooncake-Store ← Head: P2P-Mooncake-Store


📝 Commits (10+)

  • 803e015 client rpc接口定义和data_manager初步实现
  • f18d20a 解决编译问题
  • 7635a2f 补充头文件依赖
  • dc2c6bf 删除多余代码
  • 15eaf3a client集成改为optional
  • 464b8fa Merge pull request #1 from swallowCXY/cxy/client_rpc
  • 3c38290 merge upstream
  • d44cf9b add data manager test and adapt to new DataSource
  • f9c4c04 Merge pull request #2 from swallowCXY/cxy/client_rpc
  • bf95586 stub implementation and format change

📊 Changes

13 files changed (+1918 additions, -2 deletions)

View changed files

➕ mooncake-store/include/client_rpc_service.h (+85 -0)
➕ mooncake-store/include/client_rpc_types.h (+74 -0)
📝 mooncake-store/include/client_service.h (+18 -0)
➕ mooncake-store/include/data_manager.h (+134 -0)
➕ mooncake-store/include/peer_client.h (+31 -0)
📝 mooncake-store/include/types.h (+3 -2)
📝 mooncake-store/src/CMakeLists.txt (+3 -0)
➕ mooncake-store/src/client_rpc_service.cpp (+193 -0)
➕ mooncake-store/src/data_manager.cpp (+212 -0)
➕ mooncake-store/src/peer_client.cpp (+48 -0)
📝 mooncake-store/tests/CMakeLists.txt (+2 -0)
➕ mooncake-store/tests/client_rpc_service_test.cpp (+526 -0)
➕ mooncake-store/tests/data_manager_test.cpp (+589 -0)

📄 Description

Description

This PR adds a new DataManager component to provide local and remote data access APIs for Client in Mooncake Store, as mentioned in ISSUE 1209. Local data access (Put/Get/Delete) is fully implemented using TieredBackend. Remote access (ReadData/WriteData) has the framework in place (RPC types, request routing, and transfer hooks), but the transfer path is currently scaffolding-only and will be completed in follow-up PRs.

Key Changes

  • Added DataManager

    • Provides a single entry point for:
      • Local ops: Put, Get, Delete (fully implemented)
      • Remote ops: ReadData, WriteData (framework only)
    • Uses sharded locks (std::shared_mutex) to support concurrent access:
      • Lock number is configurable using environment variable MOONCAKE_DM_LOCK_SHARD_COUNT
      • Write-style ops use exclusive locks
  • Remote RPC integration (framework)

    • Defines remote request/descriptor types (RemoteBufferDesc, RemoteReadRequest, RemoteWriteRequest, batch variants).
    • ClientRpcService delegates remote read/write RPC calls to DataManager, passing RemoteBufferDesc directly.
  • Ownership + dependency model

    • DataManager owns TieredBackend (unique ownership).
    • TransferEngine remains shared (shared ownership), as it is used across components.

Type of Change

  • Types
    • Bug fix
    • [√] New feature
      • Transfer Engine
      • [√] Mooncake Store
      • Mooncake EP
      • Integration
      • P2P Store
      • Python Wheel
    • Breaking change
    • CI/CD
    • Documentation update
    • Other

How Has This Been Tested?

  • Existing build/lint checks pass.
  • Local data access is tested in data_manager_test.cpp
  • Client RPC service is tested in client_rpc_service_test.cpp
  • Remote path is not end-to-end tested yet because transfer semantics are not finalized.

Checklist

  • [√] I have performed a self-review of my own code.
  • I have updated the documentation.
  • [√] I have added tests to prove my changes are effective.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/1347 **Author:** [@swallowCXY](https://github.com/swallowCXY) **Created:** 1/9/2026 **Status:** ✅ Merged **Merged:** 1/16/2026 **Merged by:** [@wanyue-wy](https://github.com/wanyue-wy) **Base:** `P2P-Mooncake-Store` ← **Head:** `P2P-Mooncake-Store` --- ### 📝 Commits (10+) - [`803e015`](https://github.com/kvcache-ai/Mooncake/commit/803e0159a293879f594f01818bc21f3d141ea375) client rpc接口定义和data_manager初步实现 - [`f18d20a`](https://github.com/kvcache-ai/Mooncake/commit/f18d20a3c5f31a66167cf7cb967767d4162b70f2) 解决编译问题 - [`7635a2f`](https://github.com/kvcache-ai/Mooncake/commit/7635a2f081eb3a3b3a124c5aaa89897a583d31e9) 补充头文件依赖 - [`dc2c6bf`](https://github.com/kvcache-ai/Mooncake/commit/dc2c6bf5fcf19e2a1f6e89a62e51dc699f46d7c5) 删除多余代码 - [`15eaf3a`](https://github.com/kvcache-ai/Mooncake/commit/15eaf3ac4c574fe20d93a4ff7b4e3ebd1ee77110) client集成改为optional - [`464b8fa`](https://github.com/kvcache-ai/Mooncake/commit/464b8fa52d30369ec742094cdaa9e2eeff42b84a) Merge pull request #1 from swallowCXY/cxy/client_rpc - [`3c38290`](https://github.com/kvcache-ai/Mooncake/commit/3c382907c67cafde245f0be27fb9cb582f624d39) merge upstream - [`d44cf9b`](https://github.com/kvcache-ai/Mooncake/commit/d44cf9b58af2ee2d6064204a3fc9766df7d59380) add data manager test and adapt to new DataSource - [`f9c4c04`](https://github.com/kvcache-ai/Mooncake/commit/f9c4c0488737254d45acd3af374e3fe0b2c3ced0) Merge pull request #2 from swallowCXY/cxy/client_rpc - [`bf95586`](https://github.com/kvcache-ai/Mooncake/commit/bf955860c71e246b0064ec711d08f0f96f478812) stub implementation and format change ### 📊 Changes **13 files changed** (+1918 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `mooncake-store/include/client_rpc_service.h` (+85 -0) ➕ `mooncake-store/include/client_rpc_types.h` (+74 -0) 📝 `mooncake-store/include/client_service.h` (+18 -0) ➕ `mooncake-store/include/data_manager.h` (+134 -0) ➕ `mooncake-store/include/peer_client.h` (+31 -0) 📝 `mooncake-store/include/types.h` (+3 -2) 📝 `mooncake-store/src/CMakeLists.txt` (+3 -0) ➕ `mooncake-store/src/client_rpc_service.cpp` (+193 -0) ➕ `mooncake-store/src/data_manager.cpp` (+212 -0) ➕ `mooncake-store/src/peer_client.cpp` (+48 -0) 📝 `mooncake-store/tests/CMakeLists.txt` (+2 -0) ➕ `mooncake-store/tests/client_rpc_service_test.cpp` (+526 -0) ➕ `mooncake-store/tests/data_manager_test.cpp` (+589 -0) </details> ### 📄 Description ## Description This PR adds a new DataManager component to provide local and remote data access APIs for Client in Mooncake Store, as mentioned in [ISSUE 1209](https://github.com/kvcache-ai/Mooncake/issues/1209). Local data access (Put/Get/Delete) is fully implemented using TieredBackend. Remote access (ReadData/WriteData) has the framework in place (RPC types, request routing, and transfer hooks), but the transfer path is currently scaffolding-only and will be completed in follow-up PRs. <!-- A clear and concise description of the changes. Link to any relevant issues. --> ### Key Changes - **Added `DataManager`** - Provides a single entry point for: - **Local ops**: `Put`, `Get`, `Delete` (**fully implemented**) - **Remote ops**: `ReadData`, `WriteData` (**framework only**) - Uses sharded locks (`std::shared_mutex`) to support concurrent access: - Lock number is configurable using environment variable ` MOONCAKE_DM_LOCK_SHARD_COUNT` - Write-style ops use exclusive locks - **Remote RPC integration (framework)** - Defines remote request/descriptor types (`RemoteBufferDesc`, `RemoteReadRequest`, `RemoteWriteRequest`, batch variants). - `ClientRpcService` delegates remote read/write RPC calls to `DataManager`, passing `RemoteBufferDesc` directly. - **Ownership + dependency model** - `DataManager` **owns** `TieredBackend` (unique ownership). - `TransferEngine` remains shared (shared ownership), as it is used across components. ## Type of Change * Types - [ ] Bug fix - [√] New feature - [ ] Transfer Engine - [√] Mooncake Store - [ ] Mooncake EP - [ ] Integration - [ ] P2P Store - [ ] Python Wheel - [ ] Breaking change - [ ] CI/CD - [ ] Documentation update - [ ] Other ## How Has This Been Tested? - Existing build/lint checks pass. - Local data access is tested in data_manager_test.cpp - Client RPC service is tested in client_rpc_service_test.cpp - Remote path is not end-to-end tested yet because transfer semantics are not finalized. <!-- Please describe the tests you've run to verify your changes. --> ## Checklist - [√] I have performed a self-review of my own code. - [ ] I have updated the documentation. - [√] I have added tests to prove my changes are effective. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:33:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#2182
No description provided.