Repository navigation
Conversation
sssqqeer
requested review from
XucSh,
YiXR,
stmatengss and
ykwd
as code owners
October 25, 2026 14:35
sssqqeer
force-pushed
the
store/revalidate-lease-expired-reads
branch
from
October 25, 2026 16:02
f584494 to
b14ff25
Compare
sssqqeer
requested review from
ShangmingCai,
UNIDY2002,
alogfans and
staryxchen
as code owners
October 25, 2026 16:02
A read whose transfer outlives its lease returns LEASE_EXPIRED even when the object was never evicted, removed or rewritten. Long transfers (TCP fallback, large batches, cross-rack reads) then fail whole batches. When a Get or BatchGet finishes after its lease expired, ask the master once per batch whether each read replica is still the one that was read: the replica still exists (IDs are never reused), it is still readable, and the object's write version (put_start_time) is unchanged. Keys that pass keep their result; the rest return LEASE_EXPIRED as before. An older master returns no write version, and the client keeps today's behavior. Signed-off-by: shibin <306219114@qq.com>
sssqqeer
force-pushed
the
store/revalidate-lease-expired-reads
branch
from
October 25, 2026 16:21
b14ff25 to
2fac155
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of #3030 (the lease-expired Get revalidation half).
A reader gets a time-based lease from
GetReplicaList, transfers the bytes directly from the owner's segment, and then returnsLEASE_EXPIRED(-707) if the lease ran out during the transfer. The check is purely time-based: it fails the read even when the object was never evicted, removed or rewritten. Transfers longer than the lease are common with TCP fallback, large batches and cross-rack reads, so whole batches come back as misses and get re-prefilled. This matches the -707 reports in #3076 and #4825. The only workaround today is a longer lease, which leaves fewer objects evictable.This PR asks the master instead of failing outright. When a
GetorBatchGetfinishes after its lease expired, the client sends one batchedBatchCheckReplicasLive(keys, {replica_id, write_version}). A key passes if:IsReplicaReadable, the same checkGetReplicaListuses for new readers);Keys that pass keep their result. Keys that fail, or cannot be checked, get
LEASE_EXPIREDas before. An older master does not return a write version, and the client then keeps today's behavior.One host, TCP, master lease TTL set to 1 ms so every transfer outlives it. The same queried replicas are read once with today's behavior and once with this PR:
LEASE_EXPIREDLEASE_EXPIRED, 32 OKLEASE_EXPIREDLEASE_EXPIRED, 256 OKSuggested Merge Priority
Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
Test results:
master_service_test82 passed, 2 skipped;client_integration_test33 passed, 5 skipped (Ubuntu 22.04, Debug).Checklist
./scripts/code_format.shAI Assistance Disclosure