[PR #1268] [MERGED] [Store] feat Uncouple client segment meta from allocator #2119

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

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1268
Author: @wanyue-wy
Created: 12/23/2025
Status: ✅ Merged
Merged: 12/31/2025
Merged by: @wanyue-wy

Base: P2P-Mooncake-Store ← Head: uncoupled_client_segment_meta


📝 Commits (5)

  • 4632f72 rename segment manager
  • 880c5ef 1. implement segment manager
  • b4977b9 fix pure virtual function call in construct function
  • 2c8ffdc clang format
  • 58110cf fix some details

📊 Changes

19 files changed (+1416 additions, -909 deletions)

View changed files

➕ mooncake-store/include/centralized_client_manager.h (+41 -0)
➕ mooncake-store/include/centralized_segment_manager.h (+123 -0)
➕ mooncake-store/include/client_manager.h (+62 -0)
📝 mooncake-store/include/master_metric_manager.h (+0 -2)
📝 mooncake-store/include/master_service.h (+2 -23)
➕ mooncake-store/include/p2p_client_manager.h (+24 -0)
➕ mooncake-store/include/p2p_segment_manager.h (+23 -0)
➖ mooncake-store/include/segment.h (+0 -232)
➕ mooncake-store/include/segment_manager.h (+78 -0)
📝 mooncake-store/src/CMakeLists.txt (+6 -1)
➕ mooncake-store/src/centralized_client_manager.cpp (+179 -0)
➕ mooncake-store/src/centralized_segment_manager.cpp (+313 -0)
➕ mooncake-store/src/client_manager.cpp (+145 -0)
📝 mooncake-store/src/master_service.cpp (+59 -306)
➕ mooncake-store/src/p2p_client_manager.cpp (+22 -0)
➕ mooncake-store/src/p2p_segment_manager.cpp (+35 -0)
➖ mooncake-store/src/segment.cpp (+0 -260)
➕ mooncake-store/src/segment_manager.cpp (+222 -0)
📝 mooncake-store/tests/segment_test.cpp (+82 -85)

📄 Description

Description

This is the first PR for Mooncake Store P2P architecture (#1209 ). As described in the RFC, during the first implementing phase of the new architecture, we will focus on extracting the common execution paths shared by both architectures to base class and specialize architecture-specific logic in subclasses. In this PR, we reorganized the structure of segment-related code without changing its underlying processing logic. Specifically, we made the following changes:

  1. We replaced SegmentAccess with SegmentManager. SegmentManager encapsulates all segment locks within its methods and no longer exposes them externally via RAII. We can then specialize the segment management logic for each architecture separately based on SegmentManager. For example, CentralizedSegmentManager associates segments with the allocator to support the data allocation logic of the master-based centralized architecture.
  2. We implemented ClientManager to manage client states and their associated resources. It not only proxies the original segment management interface but also monitor client states by handling periodic heartbeat requests from clients. Similarly, due to the status machine of client is different from the two architectures, we also specialize the subclasses to handle with their own logic.

Additionally, in the current PR, MasterService is defaulted to the centralized architecture. In the next PR, we will apply a similar generalization to MasterService.

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?

Since the changes in this PR do not involve any modifications to underlying mechanisms, the code is verified only by the existing test suite.

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/1268 **Author:** [@wanyue-wy](https://github.com/wanyue-wy) **Created:** 12/23/2025 **Status:** ✅ Merged **Merged:** 12/31/2025 **Merged by:** [@wanyue-wy](https://github.com/wanyue-wy) **Base:** `P2P-Mooncake-Store` ← **Head:** `uncoupled_client_segment_meta` --- ### 📝 Commits (5) - [`4632f72`](https://github.com/kvcache-ai/Mooncake/commit/4632f72fe9238ea023ed3040f18cd166cc4967bf) rename segment manager - [`880c5ef`](https://github.com/kvcache-ai/Mooncake/commit/880c5eff3a4f3c41254d553f4cf87716027cc486) 1. implement segment manager - [`b4977b9`](https://github.com/kvcache-ai/Mooncake/commit/b4977b916b76deb2938b72727fc664b8e4e0a73a) fix pure virtual function call in construct function - [`2c8ffdc`](https://github.com/kvcache-ai/Mooncake/commit/2c8ffdc20e4e48533a1aaaf7767ab3a146988c51) clang format - [`58110cf`](https://github.com/kvcache-ai/Mooncake/commit/58110cfe09d8b6ecef82b7c33101493ab436c61b) fix some details ### 📊 Changes **19 files changed** (+1416 additions, -909 deletions) <details> <summary>View changed files</summary> ➕ `mooncake-store/include/centralized_client_manager.h` (+41 -0) ➕ `mooncake-store/include/centralized_segment_manager.h` (+123 -0) ➕ `mooncake-store/include/client_manager.h` (+62 -0) 📝 `mooncake-store/include/master_metric_manager.h` (+0 -2) 📝 `mooncake-store/include/master_service.h` (+2 -23) ➕ `mooncake-store/include/p2p_client_manager.h` (+24 -0) ➕ `mooncake-store/include/p2p_segment_manager.h` (+23 -0) ➖ `mooncake-store/include/segment.h` (+0 -232) ➕ `mooncake-store/include/segment_manager.h` (+78 -0) 📝 `mooncake-store/src/CMakeLists.txt` (+6 -1) ➕ `mooncake-store/src/centralized_client_manager.cpp` (+179 -0) ➕ `mooncake-store/src/centralized_segment_manager.cpp` (+313 -0) ➕ `mooncake-store/src/client_manager.cpp` (+145 -0) 📝 `mooncake-store/src/master_service.cpp` (+59 -306) ➕ `mooncake-store/src/p2p_client_manager.cpp` (+22 -0) ➕ `mooncake-store/src/p2p_segment_manager.cpp` (+35 -0) ➖ `mooncake-store/src/segment.cpp` (+0 -260) ➕ `mooncake-store/src/segment_manager.cpp` (+222 -0) 📝 `mooncake-store/tests/segment_test.cpp` (+82 -85) </details> ### 📄 Description ## Description This is the first PR for Mooncake Store P2P architecture (#1209 ). As described in the RFC, during the first implementing phase of the new architecture, we will focus on extracting the common execution paths shared by both architectures to base class and specialize architecture-specific logic in subclasses. In this PR, we reorganized the structure of segment-related code without changing its underlying processing logic. Specifically, we made the following changes: 1. We replaced `SegmentAccess` with `SegmentManager`. `SegmentManager` encapsulates all segment locks within its methods and no longer exposes them externally via RAII. We can then specialize the segment management logic for each architecture separately based on `SegmentManager`. For example, `CentralizedSegmentManager` associates segments with the allocator to support the data allocation logic of the master-based centralized architecture. 2. We implemented `ClientManager` to manage client states and their associated resources. It not only proxies the original segment management interface but also monitor client states by handling periodic heartbeat requests from clients. Similarly, due to the status machine of client is different from the two architectures, we also specialize the subclasses to handle with their own logic. Additionally, in the current PR, `MasterService` is defaulted to the centralized architecture. In the next PR, we will apply a similar generalization to `MasterService`. ## Type of Change * Types - [ ] Bug fix - [x] New feature - [ ] Transfer Engine - [x] Mooncake Store - [ ] Mooncake EP - [ ] Integration - [ ] P2P Store - [ ] Python Wheel - [ ] Breaking change - [ ] CI/CD - [ ] Documentation update - [ ] Other ## How Has This Been Tested? Since the changes in this PR do not involve any modifications to underlying mechanisms, the code is verified only by the existing test suite. ## Checklist - [x] I have performed a self-review of my own code. - [ ] I have updated the documentation. - [x] 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:32:55 +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#2119
No description provided.