mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2783] [Bug]: ssd total capacity shows 0 after master restart with snapshot and offload enabled #722
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#722
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 @liangxu2000 on GitHub (Jul 7, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2783
Bug Report
Environment
masterbranchenable_snapshot=true,enable_offloading=trueDescription
After master restarts with snapshot restore, the SSD total capacity (denominator)
in metrics shows 0, while the used space (numerator) is correct:
Before restart: Mem Storage: 400MB / 128GB | SSD Storage: 400MB / 2TB
After restart: Mem Storage: 400MB / 128GB | SSD Storage: 400MB / 0 B
^^^
The issue persists until the client also restarts (re-executes
FileStorage::Init).Root Cause (from source code analysis)
Two things happen:
1.
ssd_total_capacity_bytesis not serialized in snapshotIn
mooncake-store/src/segment.cpp, theSegmentSerializerserializesLocalDiskSegmentwith onlyenable_offloadingand the offloading objects list (line ~589-591). The fieldssd_total_capacity_bytesis not included.After deserialize (line ~927-928), a new
LocalDiskSegmentis created withssd_total_capacity_bytes = 0(default value,segment.h:88).2.
file_total_capacity_gauge is not rebuilt after restoreIn
TryRestoreStateFromSnapshot()(master_service.cpp), memory capacity is rebuilt after restore (lines 5001-5034), but there is no equivalent logic for file capacity. Thefile_total_capacity_gauge remains at its initial value 0.Note:
ReportSsdCapacityRPC is the only runtime path that setsfile_total_capacity_, but the client only calls it once atFileStorage::Init()and does not re-report after master restart.Steps to Reproduce
enable_snapshot=trueandenable_offloading=trueSSD Storage: X / 2TB(correct)SSD Storage: X / 0 B(denominator is 0)Suggested Fix
ssd_total_capacity_bytestoLocalDiskSegmentserialization/deserialization insegment.cppmaster_service.cpp, rebuildfile_total_capacity_gauge from restored segments, similar to the existing mem capacity rebuild logic (lines 5001-5034)Before submitting...
@github-actions[bot] commented on GitHub (Jul 7, 2026):
Thanks for opening this issue, @liangxu2000!
258133064A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@he-yufeng commented on GitHub (Jul 15, 2026):
Thanks for the precise root-cause analysis — the missing field in the
LocalDiskSegmentserializer was exactly it. Opened #2927, which appendsssd_total_capacity_bytesto the packed array and reads it back backward-compatibly (old snapshots keep the current behavior until the client re-reports).