mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #1381] [Store]: add ETCD snapshot object store backend in HA mode #2208
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#2208
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/Mooncake/pull/1381
Author: @00fish0
Created: 1/14/2026
Status: 🔄 Open
Base:
main← Head:dev/snapshot_etcd_storage📝 Commits (2)
110dfe1snapshot etcd backend9445d61fix ai review feedback📊 Changes
19 files changed (+1145 additions, -49 deletions)
View changed files
📝
mooncake-common/etcd/etcd_wrapper.go(+38 -0)➕
mooncake-store/include/ha/snapshot/object/backends/etcd/etcd_snapshot_object_store.h(+62 -0)📝
mooncake-store/include/ha/snapshot/object/snapshot_object_store.h(+30 -7)➕
mooncake-store/include/ha/snapshot/snapshot_socket_util.h(+48 -0)📝
mooncake-store/include/master_config.h(+14 -1)📝
mooncake-store/include/master_service.h(+11 -0)📝
mooncake-store/src/CMakeLists.txt(+1 -0)📝
mooncake-store/src/ha/snapshot/catalog_backed_snapshot_provider.cpp(+2 -1)➕
mooncake-store/src/ha/snapshot/object/backends/etcd/etcd_snapshot_object_store.cpp(+176 -0)📝
mooncake-store/src/ha/snapshot/object/snapshot_object_store.cpp(+15 -2)📝
mooncake-store/src/master.cpp(+1 -1)📝
mooncake-store/src/master_service.cpp(+381 -24)📝
mooncake-store/tests/CMakeLists.txt(+7 -0)📝
mooncake-store/tests/ha/snapshot/catalog_backed_snapshot_provider_test.cpp(+23 -5)📝
mooncake-store/tests/ha/snapshot/master_service_test_for_snapshot_base.h(+1 -1)➕
mooncake-store/tests/ha/snapshot/object/backends/etcd/etcd_snapshot_object_store_test.cpp(+180 -0)➕
mooncake-store/tests/ha/snapshot/snapshot_socket_util_test.cpp(+97 -0)📝
mooncake-store/tests/ha/snapshot/snapshot_test_utils.h(+37 -2)📝
mooncake-store/tests/ha/standby/hot_standby_snapshot_bootstrap_test.cpp(+21 -5)📄 Description
Description
Add ETCD as a snapshot object store backend, enabling master state snapshots to be persisted directly to the etcd cluster already used for HA coordination — no additional storage infrastructure required.
Key design decisions
socketpair-based IPC: Using socketpair() between the forked child (serialization) and parent process (upload). This solves the core problem: the Go runtime (cgo) cannot be called from a fork()-ed child process.
Reuse EmbeddedSnapshotCatalogStore: Instead of creating a dedicated EtcdSnapshotCatalogStore, the embedded catalog stores its index data (latest.txt, descriptor.txt) as regular keys via the SnapshotObjectStore interface. With EtcdSnapshotObjectStore, these keys are automatically stored in etcd.
Per-component ack for memory control: The child serializes and sends one component at a time (metadata → segments → task_manager → manifest), waiting for the parent's ack before proceeding to the next. This keeps peak memory to max(single component size) in both processes.
Architecture: ETCD vs Local/S3
Type of Change
How Has This Been Tested?
Checklist
./scripts/code_format.shbefore submitting.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.