Skip to content

feat: add safe client metadata rebuild for master high availability. - #2

Closed
ShuweiShen772 wants to merge 8 commits into
xLLM-AI:v0.3.12_xllm_patchfrom
ShuweiShen772:feat/ha-rebuild-two-phase-gate
Closed

feat: add safe client metadata rebuild for master high availability.#2
ShuweiShen772 wants to merge 8 commits into
xLLM-AI:v0.3.12_xllm_patchfrom
ShuweiShen772:feat/ha-rebuild-two-phase-gate

Conversation

@ShuweiShen772

Copy link
Copy Markdown

Summary

  • rebuild Master metadata from Client-owned replica records after HA failover
  • gate normal store traffic until the expected Client roster completes rebuilding
  • bind rebuild batches and completion signals to the current HA view
  • retry the full recovery transaction without reporting false completion
  • expose rebuilding, serving, and degraded states with metrics
  • enable the HA rebuild gate by default while preserving an explicit rollback flag

Validation

  • ha_rebuild_gate_test: 7 tests passed, including exact roster, stale epoch, RPC gating, timeout, and completion/timeout races
  • rebuild_retry_test: 9 tests passed, including all five failure points, whole-transaction retry, stale epoch, and shutdown interruption
  • client_metadata_rebuild_test: 7 tests passed
  • master_service_test: passed
  • 10 Clients × 5M keys: 10/10 recovered in 16.833 seconds
  • two real xLLM processes: five consecutive leader failovers passed with byte-identical output
  • explicit --enable_ha_rebuild_gate=false rollback path verified

Notes

This replaces #1 and is rebased on the latest v0.3.12_xllm_patch commit (dd44a522).

🤖 Generated with Claude Code

ShuweiShen772 and others added 8 commits August 31, 2026 22:32
Enable the master to rebuild its metadata from client-side state after a
restart, so that a fresh master process can recover segment and object
location information without recomputation.

- mooncake-store: add rebuild flow across client_service, master_service,
  master_client, rpc_service, segment and allocator
- add rebuild_types.h defining the rebuild request/response types
- add client_metadata_rebuild unit test and ha live-recovery test harness

Co-Authored-By: Claude <noreply@anthropic.com>
Strip references to internal design/impl docs (section numbers like
"impl doc §4.1" and internal .md filenames) from the HA rebuild code
comments, so the comments are self-contained for public review.
Comment-only change; no code logic modified.

Co-Authored-By: Claude <noreply@anthropic.com>
Translate the remaining Chinese comments and assertion messages in the HA
rebuild unit test to English, and replace the draft-era changelog header
with a concise English summary of the seven tests, so the file is ready
for public review. Also apply clang-format (ColumnLimit 80) across the HA
rebuild files to satisfy the format check. Comment, message, and whitespace
only; no test or code logic changed, and all seven unit tests still pass.

Co-Authored-By: Claude <noreply@anthropic.com>
Add a standalone scale benchmark for the HA metadata rebuild feature that
measures rebuild latency, scale across a key-count sweep, and recovery-window
read latency and availability. Includes the benchmark client, its driver
script, and a report of the measured results.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@ShuweiShen772

Copy link
Copy Markdown
Author

Superseded by #3, which contains the same verified HA implementation with all submitted comments translated to English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants