mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4518] [RFC]: Session-aware KV membership and explicit soft-pin controls #1152
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#1152
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 @magicYang1573 on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4518
Changes proposed
Motivation
A serving system can reuse the same KV prefix across conversations and across data-parallel workers. An insert-only session tag cannot represent all current users of a shared object, and applications need to release retention intent after context compaction without deleting cached data.
This proposal adds runtime session membership and explicit soft-retention controls to Mooncake Store. Applications provide a unique string session ID; multiple clients may contribute keys to it. Store continues to operate on physical object keys and does not interpret prompts, token order, or sliding-window attention.
API
Python methods on an initialized real
MooncakeDistributedStoreclient:ReplicateConfig.kv_sessions: list[list[str]]attach_kv_session(session_id, keys)pin_kv_session(session_id)unpin_kv_session(session_id)update_kv_session(session_id, keep_keys)close_kv_session(session_id)get_kv_session(session_id)list_kv_session_keys(session_id, cursor="", limit=1024)C++ clients expose corresponding operations, with
SetKvSessionPinfor pin/unpin. No create, generation handle, or per-key detach API is introduced. Session IDs use the client's existing tenant context; callers do not supply an additional tenant parameter.Semantics and implementation
group_ids, placement, and ranged-write sessions. It does not impose atomic group eviction.allow_evict_soft_pinned_objectscontrols pressure fallback. Read leases, hard pins, busy replicas, and group rules retain their existing meaning.Relationship to existing proposals
Validation and review questions
The implementation includes native registry/master/group regression tests and real TCP Python client tests for shared membership, tagged writes, cleanup, limits, update, and eviction behavior. A local SGLang DPA=8 integration also exercises session controls during eight concurrent decodes; this is functional evidence, not a performance claim.
Feedback requested on the API naming and its relationship to workload hints, the runtime-only lifecycle, and the explicit pin/unpin versus TTL retention model.
Before submitting a new issue...
AI assistance: OpenAI Codex assisted with implementation, tests, and this proposal. The associated implementation PR will be submitted as a draft pending human line-by-line review.
@github-actions[bot] commented on GitHub (Oct 8, 2026):
Thanks for opening this issue, @magicYang1573!
102229987A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide