mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4722] [Bug][Store] Tenant-watermark eviction removes objects without an OpLog record and releases quota before durability #1201
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#1201
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 @apex-mochen on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4722
Summary
With
enable_ha+enable_oplog+enable_multi_tenants, the eviction thread's tenant pass (EvictTenantsOverWatermark→EvictTenantMemoryForQuota, on by default attenant_eviction_high_watermark_ratio = 0.90) removes memory replicas, releases the tenant's committed quota and erases the metadata without appending any OpLog entry.BatchEvicthandles the same removal differently:persist_evict_oplog_or_skipmarks the replicasREMOVED, appendsREMOVE/PUT_ENDwith a durable finalize, and frees the replicas and quota only inFinalizeRemovedReplicasAfterDurable("HA strong-consistency: persist the post-eviction state before the helper mutates metadata"). The tenant pass has no equivalent step.Checked on main
20fc0bcand again on129c961.Reproduction (deterministic)
Regression test in
master_service_evict_scenario_test.cpp(in the linked PR):tenant-aquota = 1 KiB, one completed, lease-expired 1 KiB objectcold;coldno longer exists, but OpLog batch 3 never appears (ETCD_KEY_NOT_EXIST).On unfixed main the test fails 5/5, both on
20fc0bcand on129c961.Where it already shows up
MasterServiceEvictScenarioTest.OpLogDurabilityGatesTenantQuotaReclamationfails intermittently: nightly run 37339233838, triaged in #4485; a PR run on 2026-09-15 is also mentioned in #4136.before-durable succeededETCD_KEY_NOT_EXISTafter-durable TENANT_QUOTA_EXCEEDED20fc0bc), 33 of 50 repeats fail with exactly these messages; idle, 50/50 pass. No failing iteration contains[EVICT-RESULT], so the explicitEvictMemoryfound nothing to evict, because the tenant pass had already removedcold.Possible consequence (not reproduced end to end)
A standby replays only the OpLog, so it would keep the evicted key with its old memory descriptor. If the primary later reuses that address, the standby could hold two live-looking descriptors for one range. That is the "overlapping memory descriptors" condition from #3760, where the maintainer note says overlap "is not expected during normal operation" and the source of the stale descriptor was still open. #3760's cluster ran with
-enable_multi_tenants=true. I don't know whether a tenant quota was configured there, so I can't say this path caused it; it is one path that can produce the overlap.Proposed fix
Route the tenant pass through the same persist-before-mutate step as
BatchEvict(shared helper), and leave quota release, metadata erase and the KV-removed publish to the durable finalize when the OpLog is on. I have this fix plus the regression test ready and will open a PR shortly.@github-actions[bot] commented on GitHub (Oct 16, 2026):
Thanks for opening this issue, @apex-mochen!
265981728A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide