[Store] Add P2P hot standby runtime#2882
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the P2PHotStandbyService class and its corresponding unit tests to orchestrate P2P hot standby replication and promotion. The feedback highlights a critical data race on P2PStandbyMetadataStore during concurrent metadata exports and background replication, potential resource leaks on Start() and Promote() failures due to uncleaned pointers, and the lack of a reconnection or recovery orchestration loop to handle network interruptions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
6ca1542 to
73c9b44
Compare
Description
Add a P2P-specific hot standby runtime for replaying P2P metadata OpLog entries into
P2PStandbyMetadataStore.This PR introduces
P2PHotStandbyService, which reuses the shared OpLog and standby components (StandbyStateMachine,OpLogStoreFactory,OpLogChangeNotifier, andOpLogReplicator) while keeping the orchestration layer P2P-specific. Itintentionally does not inherit from the centralized
HotStandbyServicebecause P2P promotion needsP2PStandbyMetadataStore,P2POpLogApplier, and an export shape covering clients, segments, objects, and replicas.Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
Test results:
p2p_oplog_test passed in the local verification container. The new p2p_hot_standby_service_test.cpp is included in the p2p_oplog_test target.
Checklist
AI Assistance Disclosure
AI tools were used to help draft code changes, review diffs, and prepare PR text. The human submitter reviewed the changes and is responsible for them.