[Store] Rebootstrap standbys behind the compaction floor - #4048
Draft
Icedcoco wants to merge 3 commits into
Draft
Conversation
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
Implement N09 compaction-floor awareness and online rebootstrap for batch OpLog standbys, following RFC #3167.
When a standby cursor falls behind
/oplog/<cluster>/snapshot/compaction_floor, polling returnsREBOOTSTRAP_REQUIRED. The service pauses normal apply and becomes non-promotable while restoring an eligible latest/fallback snapshot and replaying its suffix into temporary state. Successful recovery atomically replaces the store, registry, applier, reader and cursor; failed attempts retain the old state and retry with backoff.The reader uses the current floor without retaining deleted keys, rechecks the floor when pruning races with polling, and accepts a proven cursor at the floor even if its historical batch has been deleted. Unknown suffix gaps remain fatal. Promotion and stop are guarded against recovery/swap races.
This PR does not advance the floor, prune batches, or collect snapshot objects. Production pruning remains disabled until all eligible standbys have deployed and validated N09.
Module
mooncake-transfer-engine)mooncake-store)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Debug build with
BUILD_UNIT_TESTS=ON,MOONCAKE_ENABLE_TEST_FAILPOINTS=ON,USE_CUDA=OFF,USE_ETCD=OFF,STORE_USE_ETCD=OFF, andWITH_STORE_RUST=OFF. Tests use an in-memory KV backend and local snapshot objects.Test commands:
Test results:
All five test targets pass. Coverage includes absent/deleted/invalid floors, cursor boundaries, unknown gaps, floor advancement during poll and before swap, corrupt latest with healthy fallback, suffix replay, failed recovery preserving old objects/segments, online retry after repair, promotion during recovery, successful promotion after recovery, and stop during swap. PR-scoped pre-commit hooks pass. Real-etcd E2E and production rollout validation have not been run.
Checklist
./scripts/code_format.shFormatting ran through the repository pre-commit hook. Production changes are below 500 LOC excluding tests; related design discussion is RFC #3167. Human review remains pending while this PR is a draft.
AI Assistance Disclosure
OpenAI Codex assisted with implementation, tests, code review, and this description. The human submitter must review every changed line and be able to defend the change end-to-end before marking it ready for review.