Repository navigation
[Store] Remove snapshot serializers orphaned by the legacy snapshot removal - #4774
Merged
Aionw merged 1 commit intoOct 23, 2026
Merged
Conversation
Aionw
requested review from
00fish0,
Icedcoco,
Libotry,
XucSh,
YiXR,
stmatengss and
ykwd
as code owners
October 19, 2026 11:07
Collaborator
|
I noticed that serializer_test.cpp also includes tests for the generic byte serializer in include/serializer.h, which remains in use by storage_backend.cpp. Would it be worth considering whether those tests should be kept in a separate target, since they cover code that this PR leaves in place? |
Aionw
force-pushed
the
store-remove-orphaned-snapshot-serializers
branch
from
October 20, 2026 07:13
e02e158 to
1f29d9c
Compare
…emoval kvcache-ai#4406 removed the Master-generated snapshot and restore path, but left behind the code that only that path called. None of it has a caller outside its own tests: - serialize/serializer.{h,cpp}: the msgpack Serializer<T> specializations for allocators, buffers, replicas and mounted segments, SerializationHelper and SerializationError. - ha/snapshot: StoreResourceSnapshotCodec, AllocatorSnapshotCodec and LocalSsdCodec. - SegmentSerializer and SegmentView in segment.h, TaskManagerSerializer with the restore_task/clear_all helpers only it used, and LocalSsdManager::ExportPersistedState/RestorePersistedState with LocalSsdPersistedState. - The detached snapshot path added by kvcache-ai#3706: SegmentPool::CaptureSnapshot and RestoreSnapshot, OffsetBufferAllocator and OffsetAllocator CaptureSnapshot/Restore with their snapshot structs and layout validation, AdoptMode::ReplacePool and IsKnownSegmentStatus. SegmentPool::WriteAccess::PrepareAdopt stays in its pre-kvcache-ai#3706 form: the read-lock test still uses it to install a blocking allocator. The OffsetBufferAllocator node cap goes back to the literal 64Mi it had before kvcache-ai#3706 named it OffsetAllocatorSnapshot::kMaxNodes. DestroyedPoolAndRetainedAllocatorRemoveMetricLabels stays, rewritten to mount directly instead of restoring a snapshot. kvcache-ai#3706 also made buffer allocator destructors remove their segment's metric labels and made remove_segment_metrics keep a label that still has usage; both are on the ordinary mount path and lost their only coverage with the snapshot tests.
Aionw
force-pushed
the
store-remove-orphaned-snapshot-serializers
branch
from
October 20, 2026 07:23
1f29d9c to
02eb514
Compare
ykwd
approved these changes
Oct 23, 2026
This was referenced Oct 26, 2026
0z5a
added a commit
to 0z5a/Mooncake
that referenced
this pull request
Nov 1, 2026
…-sizes Resolved conflicts: - offset_allocator.h/.cpp: keep upstream's weak_ptr allocator handle and weak_from_this() call sites, adding the PR's reserved_size parameter. - serialize/serializer.cpp: deleted upstream (kvcache-ai#4774 removed the snapshot serializers); accept the deletion, so the PR's restore-path changes there are dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Follow-up to #4406. That PR removed the Master-generated snapshot and restore path, but the serialization code only that path called is still compiled into the master. None of it has a caller outside its own tests; this PR deletes it.
Removed:
serialize/serializer.{h,cpp}: the msgpackSerializer<T>specializations for allocators, buffers, replicas and mounted segments, plusSerializationHelperandSerializationError.ha/snapshot:StoreResourceSnapshotCodec,AllocatorSnapshotCodec,LocalSsdCodec.SegmentSerializerandSegmentView(segment.h);TaskManagerSerializertogether withrestore_task/clear_all, which only it used;LocalSsdManager::ExportPersistedState/RestorePersistedStateandLocalSsdPersistedState.SegmentPool::CaptureSnapshot/RestoreSnapshot,OffsetBufferAllocatorandOffsetAllocatorCaptureSnapshot/Restorewith their snapshot structs and layout validation,AdoptMode::ReplacePool,IsKnownSegmentStatus.Kept on purpose:
SegmentPool::WriteAccess::PrepareAdopt, back to its pre-[Store] Add fork-safe SegmentPool snapshot codecs #3706 signature:AllocationKeepsReadLockAcrossAllocatorCalluses it to install a blocking allocator.SegmentPoolTest.DestroyedPoolAndRetainedAllocatorRemoveMetricLabels, rewritten to mount directly instead of restoring a snapshot. [Store] Add fork-safe SegmentPool snapshot codecs #3706 also made the buffer allocator destructors remove their segment's metric labels and maderemove_segment_metricskeep a label that still has usage. Both apply to ordinary mounts and had no other test.include/serializer.h(serialize_to/deserialize_from), whichstorage_backend.cppstill uses.SERIALIZE_FAIL/DESERIALIZE_FAIL, which are part of the publicErrorCodeenum.The only non-deletion change is in
OffsetBufferAllocator's constructor: its node cap goes back to the literal64 * 1024 * 1024it had before #3706 renamed itOffsetAllocatorSnapshot::kMaxNodes(same value,1u << 26).Overlap: #3707 (SegmentPool cutover) adapts several of these files to SegmentPool; after this lands, those hunks resolve as deletions. #4133 (stacked on #3707) removes the legacy
SegmentManageritself; this PR only removes its snapshot serializer, which nothing calls on main today.Suggested Merge Priority
Module
mooncake-store)Type of Change
How Has This Been Tested?
Release build,
BUILD_UNIT_TESTS=ON,USE_NOF=OFF.Test commands:
Test results:
DfsSyncClientTest.DfsOnlyBatchFailureOnlyRevokesFailedKey, fails the same way on unmodifiedorigin/main.origin/mainand are unrelated:tests/e2e/chaosctl.cpp(sleepundeclared) andordered_oplog_writer_test(libaio link). The three excluded tests need a network/RDMA environment.cmake-formatwas skipped: it rewrites unrelated, pre-existing lines intests/CMakeLists.txt; this PR only deletes lines there.Checklist
./scripts/code_format.sh(clang-format 20 on changed lines)cmake-format, see above)AI Assistance Disclosure
Claude Code traced the callers, made the deletions and ran the build and tests. The human submitter is responsible for reviewing every changed line and defending the change.