mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2706] [RFC]: Consolidate Master Metadata Routing #707
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#707
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 @Aionw on GitHub (Jul 1, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2706
Changes proposed
RFC: Consolidate Master Metadata Routing
Summary
MasterServiceshould keep the current tenant-isolated metadata layout:This preserves the strong tenant boundary: each tenant owns an independent
TenantState, and duplicateuser_keyvalues across tenants are naturally isolated.The proposed change is not to flatten tenant storage. Instead, it is to consolidate routing and per-object access behind a canonical object identity:
The goal is to get most of the simplicity of a flat metadata model without weakening tenant isolation. Object operations should use one routing/accessor path and then read or mutate object-scoped state from one colocated object entry.
Motivation
The current lookup path is
tenant_id + user_key -> shard -> TenantState -> metadata[user_key]. This tenant layer is useful and should remain, but object-scoped state is spread across several tenant-local maps such asmetadata,processing_keys,replication_tasks,offloading_tasks,promotion_tasks, andgroup_members.That means a single object operation can repeat the same
user_keylookup across multiple maps after it has already found the shard and tenant. It also makes routing logic easy to duplicate across call sites.The master already has
ObjectIdentityandMetadataAccessorRO/RW. This RFC proposes making that route/accessor layer the single way to reach object metadata and related state, instead of open-coding the route at individual call sites.Goals
MetadataShard::tenants[tenant_id]as the isolation boundary.ObjectIdentity{tenant_id, user_key}as the canonical input to routing and accessors.ObjectStateso common operations avoid several tenant-local map lookups.tenant_idanduser_keyseparately.defaulttenant when multi-tenant mode is disabled.Non-Goals
MetadataShard::tenants.Proposed Model
Keep the shard and tenant structure:
Use
ObjectIdentityas the canonical routing key:Normalize tenant IDs at the API boundary:
Inside each
TenantState, aggregate per-object state byuser_key:This keeps tenant isolation explicit while avoiding parallel lookups in
metadata,processing_keys,replication_tasks,offloading_tasks, andpromotion_tasks.Routing and Access
Object operations should use one route:
MetadataAccessorRO/RWshould own this route. Call sites should not manually repeat shard lookup, tenant lookup, and object-state lookup unless they are doing bulk iteration.For compatibility, the
defaulttenant may keep the currenthash(user_key)routing. Other tenants should combine tenant and key when choosing the shard.Tenant-Aware Behavior
Tenant-aware subsystems keep using tenant ID explicitly:
object_id.tenant_id.TenantStateper shard.Migration Plan
MetadataShard::tenantsandTenantStateas the storage boundary.ObjectStateinsideTenantState.MetadataAccessorRO/RWto route fromObjectIdentityto oneObjectState.metadata,processing_keys,replication_tasks,offloading_tasks, andpromotion_tasksintoObjectStatefields.group_memberstenant-local, but store the per-object group link inObjectState::group_id.ObjectState.Testing Plan
user_keyunder two tenants maps to two isolatedTenantStateentries.default.ObjectStateas metadata.Risks
ObjectStatebut tasks still live in parallel maps, losing the lookup reduction.ObjectStatemust not blur tenant boundaries; it should always live under oneTenantState.TenantStateserialization changes from parallel maps toobjects[user_key] -> ObjectState.Conclusion
Keep the tenant-nested metadata layout for strong isolation, but make
ObjectIdentityandMetadataAccessorRO/RWthe only normal route into object state. Within eachTenantState, consolidate per-object metadata, processing flags, and tasks intoObjectStateso common object operations get a flat-access experience without giving up tenant isolation.Before submitting a new issue...
@Aionw commented on GitHub (Jul 1, 2026):
Would you mind taking a look when you have time @Lin-z-w
@github-actions[bot] commented on GitHub (Jul 1, 2026):
Thanks for opening this issue, @Aionw!
41376987A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@github-actions[bot] commented on GitHub (Oct 1, 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.
@github-actions[bot] commented on GitHub (Oct 8, 2026):
Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.