Skip to content

test: wait for replica readability in native handoff gate - #362

Merged
thweetkomputer merged 1 commit into
mainfrom
fix/native-handoff-readiness
Oct 20, 2026
Merged

thweetkomputer merged 1 commit into
mainfrom
fix/native-handoff-readiness

Conversation

@thweetkomputer

Copy link
Copy Markdown
Collaborator

Context

AMD64 shard 2 failed when handoff_order read its seed during the transition from initialization to steady Follow Owner replication. The replica had completed FULL, but returned LOADING while reconnecting.

Behavior before and after

The test previously assumed that Meta reporting ready guaranteed an immediately readable replica. It now waits up to 30 seconds for the seed to become readable with its expected value.

Implementation

Use the existing H.wait_until and C.readonly_get helpers. Each probe opens a fresh connection. Keep the handoff ordering assertion and subsequent incremental-tail check.

Design decisions and alternatives

Use the same bounded data-plane polling pattern as nearby native replication scenarios. Persistent failures still fail the test.

Documentation and comments

Add a local comment explaining the initialization-to-Follow-Owner reconnect window. No architecture change: this only corrects test synchronization.

Test plan

  • cmake --build build_ci --target lavik lavik-meta lavik-ctl --parallel 6 — passed, using the existing fault-enabled Debug configuration.
  • LAVIK_TEST_DATA_DIR=/mnt/dev ctest --test-dir build_ci -R '^meta_integration\.gate_native_replication$' --output-on-failure — passed in 491.81 seconds.
  • LAVIK_TEST_DATA_DIR=/mnt/dev python3 /tmp/lavik-handoff-repeat.py — five sequential runs of the existing handoff_order fixture passed with the same binaries. The local runner only sets the executable paths and calls the fixture in a fresh temporary directory for each run.
  • pre-commit run — passed.
  • git diff --cached --check — passed.

Risk assessment

Test-only change; an unreadable or incorrect seed fails after the bounded wait.

Rollback plan

Revert this commit.

Reviewer guide

Review the readiness probe in handoff_order.

Follow-up work

None.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3de08734-ec60-4af7-a73e-c123cbaca55f
📥 Commits

Reviewing files that changed from the base of the PR and between 8f78861 and 8d0d3c2.

📒 Files selected for processing: 1
  • tests/meta_integration/gate_native_replication.py
+---------------------------------+
| Bug-free code is the new black. |
+---------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thweetkomputer
thweetkomputer merged commit 2d8a293 into main Oct 20, 2026
5 of 6 checks passed
@thweetkomputer
thweetkomputer deleted the fix/native-handoff-readiness branch October 20, 2026 03:40
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.

1 participant