mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #1957] [RFC]: Mooncake Store NVMe KV Backend #546
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#546
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 @zxpdemonio on GitHub (Apr 22, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/1957
Changes proposed
Summary
This RFC proposes a standards-aligned NVMe KV backend for Mooncake Store.
The design keeps Mooncake’s backend-neutral object interface, adds a dedicated NVMe KV backend and connector/executor stack, separates logical identity from physical key lookup, and keeps device state, placement state, and cleanup orchestration in the control plane.
The backend supports both inline objects and manifest-plus-chunk objects, works across multiple devices, and leaves a clean path for stronger multi-tenant isolation and richer scheduling policies.
Motivation
Mooncake serves AI storage paths such as KV cache offload, layered storage, and persistence of immutable or append-mostly objects. These workloads need storage that is cheaper and larger than DRAM, more object-native than file or block abstractions, fast enough for latency-sensitive runtime paths, and manageable through Mooncake’s control plane.
NVMe KV is a strong fit because it exposes key-value semantics directly at the device layer. Compared with filesystem-oriented backends, it better matches object-style access, reduces software overhead, enables natural multi-device pooling, and integrates cleanly into Mooncake’s scheduling, observability, and cleanup model.
Representative scenarios include KV cache offload, memory-to-NVMe layered storage, persistent model artifacts, and unified control-plane management of NVMe KV devices.
Goals / Non-goals
Goals
Non-goals
Proposal
The proposal adds an NVMe KV backend with four main roles:
Storage backend
The backend adapts to Mooncake’s shared storage interface and owns object semantics:
Connector
The connector owns device access semantics:
Executor
The executor owns low-level transport submission:
Control plane
The control plane owns cluster-visible authority:
The control plane does not proxy the data plane. Object I/O remains in the runtime backend path.
Data model
Object identity
The design uses an explicit logical identity abstraction:
NvmeKvObjectIdentityNvmeKvIsolationContextThe isolation context is structured to support:
tenant_iddomain_idnamespace_idEven if early deployments leave these empty, the model reserves them now so future multi-tenant isolation does not require redesigning object identity.
Physical key model
NVMe KV physical keys are bounded by device key-size limits. The design therefore requires:
The design uses:
Representative interfaces include:
EncodeNvmeKvPhysicalKey(...)EncodeNvmeKvChunkPhysicalKey(...)ComputeNvmeKvVerifyHash(...)A physical key is a placement key, not proof of identity. Reads must validate header structure, verify hash, payload checksum, and object-type-specific constraints before
returning data.
Object layout
Inline object
Small objects that fit under the effective single-value limit are stored as one object blob:
[ObjectHeader | optional identity metadata | payload]This is the preferred fast path.
Manifest-plus-chunk object
Large objects are stored as:
The manifest records enough metadata to reconstruct the full object safely, including chunk placement and integrity information.
Object header fields
Representative fields include:
magicversionobject_typepayload_sizeverify_hashpayload_checksumheader_checksumflagsidentity_metadata_sizeRepresentative identity-related fields include:
NvmeKvObjectHeader::kFlagHasIsolationContextNvmeKvStoredIdentityMetadataVisibility model
Chunked objects must not become visible until the manifest is valid. More generally, the design uses a two-step visibility rule:
Metadata and catalog model
The proposal separates two metadata scopes:
This split is intentional: backend catalog is a local recovery cache, while the control plane is the shared authority.
Control plane semantics
The control plane defines cluster-wide semantics for NVMe KV resources.
Device-state authority
Operator-facing states should include:
REGISTERINGHEALTHYDEGRADEDDRAININGDISABLEDFAILEDFULLPlacement authority
The control plane owns authoritative answers for:
This prevents stale on-device data from being treated as live data.
Shared control core
HTTP and RPC may both be used as entrypoints, but they must share one control core:
Stale convergence
If a backend stops reporting heartbeat, the control plane must converge stale device state into failed and unschedulable state rather than leaving stale healthy state visible indefinitely.
Device controls
The control plane may issue explicit operations such as enable or disable. The runtime backend applies them during heartbeat, and subsequent placement follows the updated schedulable set.
Cleanup authority
Cleanup is control-plane-orchestrated rather than hidden local deletion in the backend. This keeps reclaim observable, auditable, and aligned with placement authority.
Scheduling and cleanup semantics
Device scheduling
The initial proposal uses a simple stable policy:
This is intentionally modest and can evolve later.
Runtime device states
The backend distinguishes:
ENABLEDDISABLED_BY_CONFIGDISABLED_BY_FAILUREDISABLED_BY_CAPACITYA full device is not the same as a failed device.
Failure vs capacity-full semantics
Transport and executor layers should map capacity-full conditions to
DEVICE_CAPACITY_FULLinstead of generic write failure.This preserves the difference between:
That distinction improves scheduling, operator visibility, cleanup behavior, and retry behavior.
Cleanup modes
The proposal supports two cleanup strategies:
Manual cleanup
The caller provides an explicit selector, such as:
LRU cleanup
The control plane selects reclaim candidates from authoritative placement state, ordered by a recency signal.
Cleanup safety rules
Cleanup must be conservative and authority-driven. It should not delete objects that are:
Single active cleanup per device
Only one cleanup should run on a device at a time to reduce races and duplicated reclaim work.
Low-watermark reclaim
Cleanup should reclaim toward a low-watermark target rather than deleting an arbitrary small batch, to avoid repeated full-trigger and tiny-reclaim loops.
Automatic cleanup fallback
When a batch offload ends in
DEVICE_CAPACITY_FULL, the runtime may:This keeps recovery control-plane-driven, explicit, bounded, and observable.
Priority order during full recovery
The cleanup model should remain conservative:
read > cleanup > new write on the full device
That means:
Compatibility
Runtime compatibility
Semantic compatibility
The proposal preserves familiar Mooncake semantics:
Forward compatibility
The design leaves room for:
Alternatives considered
Treat NVMe KV as a special-purpose side path
Rejected because it would leak device-specific logic into upper layers, fragment scheduling behavior, and weaken consistent control-plane integration.
Collapse connector and backend into one layer
Rejected because it would mix object semantics, placement logic, capability discovery, and transport-specific execution in one component, making the design harder to evolve and less vendor-neutral.
Use physical key alone as object identity
Rejected because collision or stale device data could cause wrong-object reads. The proposal instead requires verify-hash and checksum validation.
Let the backend perform hidden local cleanup on full
Rejected because it would bypass control-plane authority, reduce observability, and increase reclaim risk under transient runtime conditions.
Build a complete reconcile/orphan framework first
Rejected because it would delay delivery of the useful core backend. The first version instead prioritizes correct live-path behavior and correct cleanup of authority-known objects.
Drawbacks / Risks
Open questions
tenant_id,domain_id, andnamespace_idbecome active routing inputs, how should placement, cleanup, and observability be partitioned?Before submitting a new issue...
@zxpdemonio commented on GitHub (Apr 22, 2026):
Architecture
Data model
Object layout
Full-device recovery
@github-actions[bot] commented on GitHub (Jul 22, 2026):
This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.
@zxpdemonio commented on GitHub (Jul 24, 2026):
https://github.com/kvcache-ai/Mooncake/pull/2167 pr updated
@github-actions[bot] commented on GitHub (Oct 24, 2026):
This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.