[Store] Add bounded standby promotion handoff - #3841
Conversation
9a508ea to
d3d4185
Compare
|
Nice direction—the move-only handoff removes the second full object vector, while restore keeps cross-chunk duplicate, range, and capacity validation, and RPC registration remains behind the completed restore. One non-blocking question: |
|
Yes, this is intentional. producer_view_version is diagnostic only: the new primary claims and uses its own leader view, so it must not reuse the standby’s view. applied_cursor.batch_id is retained for cursor identity and audit; the batch reader already validates batch/sequence continuity, while the new primary writer reloads the authoritative full DurablePrefix from the backend. Therefore the restore path only needs the sequence portion and max_replica_id; no runtime change is required. A short comment can make this contract explicit. @catyans |
|
Fixed in
Validation: scoped pre-commit passed; promotion tests 7/7, final catch-up tests 10/10, and restore-related HA tests 16/16 passed. The complete |
Description
Depends on #3811.
Implement PR-N07 bounded standby promotion for the batch-OpLog snapshot path:
StandbyMetadataStoreinto a move-only promotion context instead of exporting a second full object vector;ReplicaIDthrough the handoff;batch_oplog_retry_timeout_secas a no-progress timeout during final catch-up instead of a fixed 30-second total deadline;GitHub cannot use
dev/oplog-ha-prs/I00as the upstream base because that branch exists only in the contributor fork. #3811 is now merged intomain; this branch has been rebased onto the resultingmainand is N07-only. The N07 commit is d3d418584.#3806 also edits
RestoreFromStandbySnapshot, but for different semantics: it tolerates and discards malformed objects. This PR bounds ownership and conversion memory while retaining the current R01 fail-closed behavior. If #3806 lands first, the shared restore implementation will need a semantic rebase rather than duplicating either path.Module
mooncake-store)Type of Change
How Has This Been Tested?
Test commands:
cmake --build /tmp/mooncake-n07-build --target hot_standby_service_test hot_standby_snapshot_bootstrap_test standby_metadata_store_test batch_oplog_snapshot_provider_test batch_oplog_snapshot_promotion_test master_service_ha_test batch_oplog_promotion_bench -j8 ctest --test-dir /tmp/mooncake-n07-build --output-on-failure -R '(^hot_standby_service_test$|^hot_standby_snapshot_bootstrap_test$|^standby_metadata_store_test$|^batch_oplog_snapshot_provider_test$|^batch_oplog_snapshot_promotion_test$|^master_service_ha_test$)' /tmp/mooncake-n07-build/mooncake-store/benchmarks/batch_oplog_promotion_bench --objects=10000 --chunk_objects=128The build used
STORE_USE_ETCD=ONso the final catch-up tests were compiled.Test results:
master_service_ha_testsuitePromotionCatchUpTestcases passedAGENTS.mdChecklist
AI Assistance Disclosure
The human submitter must review every changed line and be able to defend the change end-to-end before merge.