mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #3030] [RFC]: Replica-ID Validation for PutEnd / PutRevoke and GetReplicaList #780
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#780
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 @ykwd on GitHub (Jul 21, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/3030
Changes proposed
mooncake-store)Motivation
1. Same-client stale PutEnd / PutRevoke after PutStart preemption
PutEnd/PutRevokecurrently only check thatclient_idmatches the object's writer. This rejects a different client after preemption, but fails when the same client starts a second write that preempts an earlier in-progress write:PutStartcan reclaim afterput_start_discard_timeout;UpsertStartpreempts immediately. A stalePutEndmay mark R2COMPLETEbefore data is written; a stalePutRevokemay delete R2 while Put#2 is still in progress.2. False Get failures after lease expiry
On Get, the client first calls
GetReplicaList(or equivalent) to obtain a replica list and a lease TTL, then transfers data. If the lease expires before the transfer finishes, the client returnsLEASE_EXPIREDeven when the underlying replicas are still valid, to avoid reading data that may have been evicted or replaced. For slow or large transfers this causes avoidable failures: the object may still exist unchanged, but without the replica IDs fromGetReplicaList, the client cannot ask the master whether those same replicas are still live.Proposal
Use replica IDs as the durable identity of allocated replicas.
PutStart/UpsertStart/GetReplicaListall return them to the client;PutEnd/PutRevokeand lease-expired Get revalidation consume them.Globally unique ReplicaID
ReplicaID(uint64_t) already exists on each replica. Strengthen allocation as follows:next_id_to a randomuint64.id = next_id_.fetch_add(1)(atomic).Return ReplicaID from PutStart / UpsertStart / GetReplicaList
Every replica descriptor returned by
PutStart,UpsertStart, andGetReplicaList(including batch variants) must include a non-zeroReplicaID. Clients retain these IDs for the matching write completion or for Get revalidation after lease expiry.PutEnd / PutRevoke validate replica IDs
Extend end/revoke RPCs to carry the replica ID from the matching
PutStart/UpsertStart:Lease-expired Get revalidation via GetReplicaList IDs
The client keeps the replica IDs from the initial
GetReplicaList. After transfer, if the lease has expired, it re-queries the master with those ID. If the same IDs still exist and areCOMPLETE, return success; otherwise fail as today (LEASE_EXPIRED/INVALID_REPLICA).Before submitting a new issue...
@github-actions[bot] commented on GitHub (Jul 21, 2026):
Thanks for opening this issue, @ykwd!
11404354A 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 20, 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.
@sssqqeer commented on GitHub (Oct 24, 2026):
@ykwd I'd like to take the lease-expired Get revalidation part of this RFC. I have a working version and will open a PR soon.