mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #5035] [RFC]: Distributed-filesystem offload root with cluster-wide quota and master-driven eviction #1273
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#1273
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 @kdtmac on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/5035
Context
Of the KV caches we evaluated, Mooncake Store is the closest to giving us a single control point: the master owns admission, tenant quota and eviction, and the offload tier extends capacity past DRAM. That centralized shape is exactly what we want — which is why the remaining gap is specific rather than general.
What we rely on today:
max_bytes; #2153 argues Mooncake should own both resource allocation and object identity, deriving enforceable quota from actual allocatable capacity);BucketStorageBackend—MOONCAKE_OFFLOAD_FILE_STORAGE_PATH, bounded byMOONCAKE_OFFLOAD_BUCKET_MAX_TOTAL_SIZE_LIST, with one FIFO/LRU order overbuckets_, and (per #4230) a cap that deliberately tracks physical usage because KubernetesemptyDirdeployments depend on it.The gap: our offload root is a shared filesystem, not a local SSD
We want the offload tier on a distributed filesystem (3FS / JuiceFS / NFS / CephFS) so that (a) it survives pod rescheduling onto another node, and (b) capacity is a cluster resource instead of N independent per-node caps.
As #4230 summarizes the current design — one root, one
total_size_counter, one FIFO/LRU order overbuckets_— three things break in that configuration:buckets_ordering. A bucket written by client A can be evicted by client B while A still considers it resident; neither accounts for the other's bytes. On shared storage "evict the oldest bucket I know about" is not a global policy — it's two independent policies over one dataset.fs::space()ignoring cgroup/emptyDirquotas. On a DFS,fs::space()reports the whole filesystem — shared with unrelated workloads, and usually wrong about the share we own (reservations, replication, project quotas). So the one number the offload tier uses to decide "full" isn't meaningful.There is a real risk here beyond waste: two clients racing on the same bucket, one deleting while the other reads, is the same class of bug as #4686 (L4 offload matched by key alone) and #4725 (stale replica attached to a republished key) — those are local-SSD races; a shared root makes them cluster-wide and much easier to hit.
Proposal
Make offload-tier capacity policy master-owned, mirroring what already exists for DRAM:
emptyDirdeployments are unaffected.offload_capacity_bytesor a tenant quota row) rather than astatfsguess, so a DFS with replication or project quotas doesn't misreport available space.Questions
We'd be glad to contribute a cluster-scoped offload-capacity registration plus master-driven eviction, with node-local behaviour preserved as the default, if maintainers think the shape is reviewable.
References
fs::space(), ignores cgroup/emptyDirquotas@github-actions[bot] commented on GitHub (Oct 28, 2026):
Thanks for opening this issue, @kdtmac!
22338707A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide