mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2636] [Bug]: Snapshot restore loses segment protocol and allocator replica_type #691
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#691
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 @mzygQAQ on GitHub (Jun 26, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2636
Originally assigned to: @mzygQAQ, @Icedcoco on GitHub.
Bug Report
Description
After master restart with snapshot restore (
enable_snapshot_restore=1), all memory segments lose theirprotocolfield. The admin API returns"protocol": ""even though the segment was originallymounted with
"protocol": "tcp".Additionally,
OffsetBufferAllocator::replica_type_is also lost during serialization, which affects NoF segment metric accounting (restored NoF segments are counted under "mem" instead of "nof").Reproduction
Note that protocol is empty even though the segment was mounted with --protocol tcp.
Root Cause
The snapshot serialization code in serializer.cpp uses custom msgpack serializers (not YLT_REFL auto-serialization) for both MountedSegment and OffsetBufferAllocator. These custom serializers missed two
fields:
Serialize (serializer.cpp:829-868) packs 8 elements:
But the Segment struct has 6 fields: id, name, base, size, te_endpoint, protocol. protocol is never serialized.
After restore, segment.protocol defaults to empty string "".
Serialize (serializer.cpp:930-954) packs 6 elements:
But OffsetBufferAllocator has replica_type_ which determines whether metrics are counted as MEMORY or NOF_SSD. replica_type_ is never serialized.
After restore, the allocator is reconstructed with the default ReplicaType::MEMORY, so any NoF segment's metrics are incorrectly counted under memory.
Fix Options
Option A: Add missing fields to serialization (no backward compat)
Add the fields at the natural position in the serialization arrays:
Old snapshots become unreadable, but given that the restore cleanup bug (#TODO) already makes old snapshots unreliable, this is acceptable.
Option B: Backward-compatible fix (more complex)
Append the new fields at the end of the arrays and add size detection in deserialization:
This preserves the ability to read old snapshots but adds complexity.
Before submitting...
@github-actions[bot] commented on GitHub (Jun 26, 2026):
Thanks for opening this issue, @mzygQAQ!
30590325A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@Icedcoco commented on GitHub (Jun 29, 2026):
Hi @mzygQAQ , I’ve completed the minimal fix for #2636 and opened PR #2668.
This update preserves
MountedSegment.protocolandOffsetBufferAllocator.replica_type_in snapshot serialization, while keeping legacy snapshot formats readable for backward compatibility. I did not extend the NoF service-level snapshot path in this change; the fix is intentionally scoped to the field-loss issue reported here.Could you take a look at #2668 and let me know if the fix matches your expectations?
@mzygQAQ commented on GitHub (Jul 1, 2026):
hi, @Icedcoco thanks for your work, I'm on a business trip and unable to verify it in the near future. I'm sorry — if you have the environment, you can go ahead and verify it yourself :)
@github-actions[bot] commented on GitHub (Sep 30, 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.
@github-actions[bot] commented on GitHub (Oct 8, 2026):
Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.