Commit Graph

26 Commits

Author SHA1 Message Date
Dmitry Barsukoff dd9f8ae004
[Store] Allow customizing client port range (#2008)
* [ADD] MC_STORE_CLIENT_MIN_PORT and MC_STORE_CLIENT_MAX_PORT environ

* [UPD] documentation

---------

Co-authored-by: Copilot <copilot@github.com>
2026-05-05 00:13:01 +08:00
Venkat Raman 3ac7de25ac
[Store] Add lock-free MmapArena allocator for buffer mmap path (#1820)
* [Store] Add lock-free MmapArena allocator for buffer mmap path

Replace per-allocation mmap() syscalls in allocate_buffer_mmap_memory()
with a lock-free atomic bump allocator (MmapArena). Pre-allocates a
configurable pool (default 64GB) and serves allocations via CAS loop,
reducing allocation latency from ~1us (mmap syscall) to ~50ns (atomic).

Allocation lifecycle is static: all callers (ClientBufferAllocator,
global segments in RealClient::setup_internal) allocate at startup and
free at shutdown. The arena outlives all allocations, so the bump-only
(no individual free) design is correct for this usage pattern.

Feature-flagged via gflags:
  --use_mmap_arena_allocator (default: true)
  --mmap_arena_pool_size (default: 64GB)

Falls back to direct mmap() when arena is disabled, fails to init,
or is exhausted.

Cherry-picked from flow-ipc-poc branch (utils.cpp perf path only).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [Store] Fix three correctness issues in MmapArena

1. Honor caller's alignment contract: allocate() now accepts a
   per-call alignment parameter and uses max(arena default, caller
   request). allocate_buffer_mmap_memory() forwards its alignment
   argument to the arena. Previously, the caller's alignment was
   silently ignored — the arena always used 64-byte alignment
   regardless of what the caller requested.

2. Remove MAP_POPULATE from arena pool mmap: the default pool is
   64GB but callers typically use only a fraction (e.g. 4GB of
   segments). MAP_POPULATE would pre-fault all 64GB of pages upfront,
   causing seconds of startup delay and potentially triggering OOM
   on machines with less physical memory. Pages now fault on demand.

3. Make alignment_ atomic and store it BEFORE the CAS on pool_base_:
   previously alignment_ was a plain size_t written AFTER the release
   CAS, so the store was not in the happens-before relationship
   established by the acquire-release pair on pool_base_. Now both
   alignment_ and pool_size_ are stored before the CAS with the
   release fence guaranteeing their visibility to readers.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 14:18:18 +08:00
ykwd 9ce5d25292
update docs (#1905)
Co-authored-by: Ke Yang <yangke@approaching.ai>
2026-04-16 23:23:11 +08:00
fatSheep 7d0978b9ca
[Store] Add Upsert API for in-place object updates (#1662)
Co-authored-by: fatSheep <tzh2005t@gmail.com>
2026-04-03 10:24:37 +08:00
Yufeng He 4c19802458
[Store] Add hard pin mechanism for eviction-protected objects (#1728)
* [Store] Add hard pin mechanism for eviction-protected objects

Objects created with ReplicateConfig.with_hard_pin=true are never
evicted by the eviction policy, providing guaranteed persistence
for model weights in RL and model management workloads.

Changes:
- ReplicateConfig: add with_hard_pin field (default false)
- ObjectMetadata: add hard_pinned boolean, set at creation via PutStart
- BatchEvict: skip hard-pinned objects in all eviction passes
- Serialization: persist hard_pinned in snapshots (backward compatible
  with old format that lacks the field)
- Tests: verify hard-pinned objects survive eviction, coexist with
  soft pin, and can still be explicitly removed
2026-03-25 17:41:40 +08:00
zhangzuo21 f40407eb59
[Docs] Add SSD offload documentation (#1647) 2026-03-19 15:37:59 +08:00
yizheng 5fe8e21e7c
[Store] Implement Metadata Persistence and Recovery for Master Service (#1431) 2026-03-02 11:20:33 +08:00
fatSheep 9e4e9490b2
[Doc]: add allocation strategy documentation with user guidance (#1577)
* docs: add allocation strategy documentation with user guidance

Document the three built-in allocation strategies (random, free_ratio_first, cxl)
with a user-facing comparison table, selection guidance, and detailed descriptions.

* Update docs/source/design/mooncake-store.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update docs/source/design/mooncake-store.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: fatSheep <tzh2005t@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-02 10:50:31 +08:00
tang c724318217
[Store][Feature] copy and move client support (#1364)
* [Store]: add task executor feature with unit and executor test

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>

* [Store]: add some optimizations to task executor

Refactor the task_executor into the client_service and add a
task structure on the client side. Additionally, remove the
existence check in the execute function;
only retrying should be performed if replica allocation fails.

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>

* [Store]: get source replica from copyStart or moveStart api

* [Store]: call move or copy end if the target replica already exist to complete the replication task

* [Store]: use the max_retry_attempts in master side

* [Store]: add client integration test and set default max_retry_attempts to 10

* [Doc] update task api introduction

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>

* [Store] Set copy and move as private methods

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>

* [Doc]: change the default task max_retry_attempts to 10

* [Doc]: fix some description error

* [Store]: allocate the buffer size to be a multiple of 16MB

* [Store]: validate the replica is in local and directly construct slices from replica buffer address instead of copy the data to local buffer

* [Store]: change the validate logic to directly use transfer engine endpoint or local_hostname_.

* [Store] add e2e ci test for copy and move api

* [Store] refactor the client move and copy function

* [Store] fix the e2e test

* [Store] remove unused code

* [Store] add source field when build replica copy payload in the task_manager_test

* [Store] rename back to snake case for split_into_slices function and also remove hard code for client poll count

* [Store] revert mis deleted field when resolve conflicts

* [Store] change test to validate the real behaviour

* [Store] change the default task fetch size to 16

* [Doc]: change the replica copy/move sequence diagram

* [Store] add new split_into_slice method

* [Store] change the real client to use split_to_slice with buffer handle parameters

---------

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>
Co-authored-by: Vincent Gao <vincentbo@linux.alibaba.com>
2026-02-06 19:02:02 +08:00
EkiRui e0ddd91629
[Store] add HugePage support (#1300)
* [Store] add HugePage support

Co-authored-by: Teng Ma <sima.mt@alibaba-inc.com>
Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>

* doc: add huge page env introduction

Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>

---------

Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>
Co-authored-by: Teng Ma <sima.mt@alibaba-inc.com>
2025-12-30 16:12:40 +08:00
EkiRui 70488aae3f
[Store]doc: add dummy client support for SGLang hicache integration (#1299)
Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>
2025-12-29 16:50:26 +08:00
Jianxin 38138f9136
[Doc] Hotfix: Remove duplicate docs (#1211) 2025-12-15 14:17:09 +08:00
Jianxin df201882b2
[Doc] Merge doc to docs (#1153)
* merge doc/en/ to docs/

* move chinese documents to an archive directory
2025-12-15 12:08:49 +08:00
Vincent-Bo-ali 024b695a8d
[Store] feat: Add BatchReplicaClear API for manual cache cleanup (#1191)
* [Store] feat: Add BatchReplicaClear API for manual cache cleanup

Implement the `BatchReplicaClear` API to allow clients to manually clear
cached object replicas. This feature enables explicit storage management
by deleting replicas for specified keys. The implementation is end-to-end,
from the client to the master service.

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>

* [Store] feat: Fix BatchReplicaClear monitor issues

Fixed issues with monitoring metrics not being updated and function naming.
Fix the issue of unclear descriptions in the file.

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>

---------

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>
2025-12-12 23:08:48 +08:00
Vincent-Bo-ali 72bfa28c04
[Store] feat: Add BatchQueryIp API for querying multiple client IPs (#1162)
* [Store] feat: Add BatchQueryIp API for querying multiple client IPs

Add BatchQueryIp API with client test and master server test

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>

* [Doc] Add API documents for BatchQueryIp

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>

---------

Signed-off-by: Vincent Gao <vincentbo@linux.alibaba.com>
2025-12-08 17:29:04 +08:00
Jinlong Chen 2361749062
[Store]: Refactor AllocationStrategy implementation for better performance and flexibility (#1149) 2025-12-04 20:08:33 +08:00
EkiRui 7517db4585
[Store] feat: Add standalone deployment implementation for Client (#1084)
* [Store]: Add independent deployment implementation for Client

Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>

* [Doc]: mooncake-store: add introduce for client standalone mode

Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>

* [CI]: Add dummy client test

Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>

* [Store]: Change dummy client setup into a new func

Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>

* [Store]: Add more log for dummy client

Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>

---------

Signed-off-by: Xingrui Yi <yixingrui@linux.alibaba.com>
2025-11-25 23:57:30 +08:00
Teng Ma 25364661e3
[Store] add version checking between client and server (#1061) 2025-11-24 20:26:57 +08:00
Jinlong Chen 6d05c9344b
[Store] Add Timeout Mechanism for Put Operations (#993) 2025-11-06 10:37:13 +08:00
Liziqi-77 545302ccaf
[DOC] Fix documentation link (#949) 2025-10-23 14:12:19 +08:00
ykwd b57c3d2781
[Doc] Add Clarification for STORE_USE_ETCD Compile Option (#927) 2025-10-14 19:29:44 +08:00
ykwd 52bb108340
[Doc] Add Mooncake x SGLang Hicache Design and Some Updates (#913) 2025-10-10 15:17:24 +08:00
ykwd 5bd25ddb68
[Docs] Update Obsolete Content & Fix Minor Problems (#880)
* Fix bugs

* Update get and put description

* Update allocator description

* Address review comments

* Update strong consistency description

* Update error code
2025-09-24 12:20:43 +08:00
ykwd c5cce40ee7
[Store] Check If Get Operation Completed Within Lease (#778) 2025-09-24 11:43:23 +08:00
JinYan Su dafaaad076
feat(store): add client heartbeat support for non ha mode (#845)
* feat(store): add client heartbeat support for non ha mode

This change extends client functionality to handle master reconnection and segment remounting in non-HA mode, adds corresponding test infrastructure, and improves utility functions for HTTP operations and port allocation.

Signed-off-by: xiaguan <751080330@qq.com>

* refactor(tests): reorganize test entries in CMakeLists.txt

* update docs

---------

Signed-off-by: xiaguan <751080330@qq.com>
Co-authored-by: Ke Yang <oneday117@qq.com>
2025-09-17 14:54:48 +08:00
ykwd 8bdb472c19
[Doc] SGLang HiCache Intergration (#833) 2025-09-15 14:05:51 +08:00