[PR #744] [MERGED] [Store] Add replication guarantees #1789

Closed
opened 2026-10-29 21:30:21 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/744
Author: @vladnosiv
Created: 8/13/2025
Status: ✅ Merged
Merged: 8/25/2025
Merged by: @stmatengss

Base: main ← Head: store-replication


📝 Commits (10+)

  • 526bc58 add replication guarantees
  • a05f2c6 refactor implementation
  • 332cb9b Merge branch 'main' into store-replication
  • 8e35f37 fix merge aftermath
  • 973645f less copies
  • 5ffb4de try fix wheel tests
  • e306c97 fix wheel tests
  • 7cababc remove old comment
  • 62fa750 fix wheel tests and add replication fault tolerance wheel test
  • 6703699 Merge branch 'main' into store-replication

📊 Changes

14 files changed (+900 additions, -409 deletions)

View changed files

📝 doc/en/architecture.md (+1 -1)
📝 doc/en/mooncake-store-preview.md (+10 -3)
📝 doc/zh/architecture.md (+1 -1)
📝 doc/zh/mooncake-store-preview.md (+8 -2)
📝 docs/source/design/architecture.md (+1 -1)
📝 docs/source/design/mooncake-store-preview.md (+10 -3)
📝 mooncake-store/include/allocation_strategy.h (+182 -64)
📝 mooncake-store/include/types.h (+27 -0)
📝 mooncake-store/src/master_service.cpp (+12 -26)
📝 mooncake-store/tests/allocation_strategy_test.cpp (+236 -76)
📝 mooncake-store/tests/master_service_test.cpp (+100 -23)
📝 mooncake-wheel/tests/test_distributed_object_store.py (+5 -209)
➕ mooncake-wheel/tests/test_replicated_distributed_object_store.py (+306 -0)
📝 scripts/run_tests.sh (+1 -0)

📄 Description

The current slice replication mechanism in the Store does not provide any guarantees. For example, for replication factor 2, both replicas can be allocated to the same segment.

This PR adds a guarantee for replication. When using replication factor N, the loss of any N-1 segments will not make it impossible to read the key.

From the point of view of implementation, I have now made a version with a minimum number of changes for ease of review. Nevertheless, it seems logical to me that the allocator could return buffers by the number of replicas for each slice, in which case the logic for ensuring guarantees would be on the allocator's side. I can rewrite it to this version.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/744 **Author:** [@vladnosiv](https://github.com/vladnosiv) **Created:** 8/13/2025 **Status:** ✅ Merged **Merged:** 8/25/2025 **Merged by:** [@stmatengss](https://github.com/stmatengss) **Base:** `main` ← **Head:** `store-replication` --- ### 📝 Commits (10+) - [`526bc58`](https://github.com/kvcache-ai/Mooncake/commit/526bc5856827fa50abbd45f953ba44d287fc8c57) add replication guarantees - [`a05f2c6`](https://github.com/kvcache-ai/Mooncake/commit/a05f2c6964ada62406428cba47defb3af9d032af) refactor implementation - [`332cb9b`](https://github.com/kvcache-ai/Mooncake/commit/332cb9b9a761f075a1a5f6fc0ee000326cf3bfc4) Merge branch 'main' into store-replication - [`8e35f37`](https://github.com/kvcache-ai/Mooncake/commit/8e35f3712e1357443e3762d771ee015cbb666dab) fix merge aftermath - [`973645f`](https://github.com/kvcache-ai/Mooncake/commit/973645f465dc9a2f7d25ea0f45e59356b9c8a8a5) less copies - [`5ffb4de`](https://github.com/kvcache-ai/Mooncake/commit/5ffb4de824aec6dd97044614aedc613128ed904c) try fix wheel tests - [`e306c97`](https://github.com/kvcache-ai/Mooncake/commit/e306c973501957ec9765bda7b6fc32a2eeb73cc7) fix wheel tests - [`7cababc`](https://github.com/kvcache-ai/Mooncake/commit/7cababcb91f865170241a490891f647816a5ecc3) remove old comment - [`62fa750`](https://github.com/kvcache-ai/Mooncake/commit/62fa75069dfa03ffcad5637dbcde749a72b74a0c) fix wheel tests and add replication fault tolerance wheel test - [`6703699`](https://github.com/kvcache-ai/Mooncake/commit/670369901fa182e4dcbfd181b644384441107392) Merge branch 'main' into store-replication ### 📊 Changes **14 files changed** (+900 additions, -409 deletions) <details> <summary>View changed files</summary> 📝 `doc/en/architecture.md` (+1 -1) 📝 `doc/en/mooncake-store-preview.md` (+10 -3) 📝 `doc/zh/architecture.md` (+1 -1) 📝 `doc/zh/mooncake-store-preview.md` (+8 -2) 📝 `docs/source/design/architecture.md` (+1 -1) 📝 `docs/source/design/mooncake-store-preview.md` (+10 -3) 📝 `mooncake-store/include/allocation_strategy.h` (+182 -64) 📝 `mooncake-store/include/types.h` (+27 -0) 📝 `mooncake-store/src/master_service.cpp` (+12 -26) 📝 `mooncake-store/tests/allocation_strategy_test.cpp` (+236 -76) 📝 `mooncake-store/tests/master_service_test.cpp` (+100 -23) 📝 `mooncake-wheel/tests/test_distributed_object_store.py` (+5 -209) ➕ `mooncake-wheel/tests/test_replicated_distributed_object_store.py` (+306 -0) 📝 `scripts/run_tests.sh` (+1 -0) </details> ### 📄 Description The current slice replication mechanism in the Store does not provide any guarantees. For example, for replication factor 2, both replicas can be allocated to the same segment. This PR adds a guarantee for replication. When using replication factor N, the loss of any N-1 segments will not make it impossible to read the key. From the point of view of implementation, I have now made a version with a minimum number of changes for ease of review. Nevertheless, it seems logical to me that the allocator could return buffers by the number of replicas for each slice, in which case the logic for ensuring guarantees would be on the allocator's side. I can rewrite it to this version. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:30:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#1789
No description provided.