mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2457] [Store] Count LOCAL_DISK-only GetReplicaList hits in master SSD cache-hit metrics #653
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#653
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 @feichai0017 on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2457
Originally assigned to: @feichai0017 on GitHub.
Problem
Mooncake Store exposes master cache-hit stats such as
memory_hitsandssd_hitsviaMasterMetricManager::calculate_cache_stats().Currently
MasterService::GetReplicaList()increments cache-hit metrics by checking only the first returnedReplica::Descriptor:is_memory_replica()->inc_mem_cache_hit_nums()is_disk_replica()->inc_file_cache_hit_nums()However SSD offload uses
ReplicaType::LOCAL_DISK, represented byLocalDiskDescriptor, which is separate fromDiskDescriptor.Replica::Descriptor::is_disk_replica()does not matchLocalDiskDescriptor.This means a LOCAL_DISK-only object can be returned successfully by
GetReplicaList()whilessd_hitsdoes not increase. In that casevalid_get_numscan increase, but neither memory nor SSD hit counters reflect the successful LOCAL_DISK hit.Code pointers
mooncake-store/src/master_service.cpp:MasterService::GetReplicaList()classifies hits usingreplica_list[0].is_memory_replica()/replica_list[0].is_disk_replica().mooncake-store/include/replica.h:Replica::Descriptorhas separateDiskDescriptorandLocalDiskDescriptorvariants.mooncake-store/tests/promotion_on_hit_test.cpp: existing tests create LOCAL_DISK-only metadata viaNotifyOffloadSuccessand expectGetReplicaList()to succeed.Proposed fix
Classify cache-hit metrics from the complete replica list instead of checking only
replica_list[0]:Test plan
Add a focused unit test in
mooncake-store/tests/master_metrics_test.cpp:MasterServicewith offload enabled.NotifyOffloadSuccess.GetReplicaList(key, "default").CacheHitStat::SSD_HITSincreases by one.@github-actions[bot] commented on GitHub (Jun 13, 2026):
Thanks for opening this issue, @feichai0017!
132118805A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide