fix(upgrade-journey-raft): read post-restart sanity checks at QUORUM - #415
Open
jfrancoa wants to merge 1 commit into
Open
fix(upgrade-journey-raft): read post-restart sanity checks at QUORUM#415jfrancoa wants to merge 1 commit into
jfrancoa wants to merge 1 commit into
Conversation
Async replication became default-on for RF>1 in weaviate#11214. A CL=ONE read immediately after the rolling restart can land on a replica still mid-reconciliation and under-count (e.g. the dystopian cross-ref filter returning <5 authors), failing the sanity checks even though the data is intact on the cluster. Switch the three read-path sanity checks (Books, Authors, and the multitenancy near_text) to QUORUM so they assert "data survived the upgrade + restart" rather than one arbitrary replica's not-yet-converged view. No assertions changed; the import write CL is left as-is. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
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.
Motivation
The
upgrade-journey-raftchaos suite intermittently failed its post-restart sanity checks — e.g. the dystopian cross-ref filter returning fewer than 5 authors, or the multitenancynear_textunder-counting. The data was intact on the cluster; the reads were just landing on a replica that hadn't finished reconciling yet.The root cause is a behavioral change in core: async replication became default-on for RF>1 in weaviate#11214. A
CL=ONEread issued immediately after the rolling restart can be served by any single replica, including one still mid-reconciliation, which under-counts and trips the assertions.Approach
Switch the three read-path sanity checks (Books, Authors, and the multitenancy
near_text) fromConsistencyLevel.ONEtoConsistencyLevel.QUORUM. With QUORUM the read is satisfied by a majority of replicas, so it reflects converged data rather than one arbitrary replica's not-yet-reconciled view. This makes the checks assert what they actually intend — "the data survived the upgrade + restart" — instead of "this one replica happens to be caught up."Scoped deliberately to the reads only: no assertions were changed, and the import write consistency level is left as-is, so the test still exercises the same write path and verifies the same expected counts.
Key areas for review
apps/upgrade-journey-raft/books.py—_books_sanity_checksand_authors_sanity_checks, the two aggregate/query reads now at QUORUMapps/upgrade-journey-raft/multitenancy.py—_books_sanity_checks, the per-tenantnear_textread now at QUORUMRisks and mitigations
Testing
This is a fix to the chaos test harness itself; correctness is demonstrated by the suite no longer flaking on the post-restart reads. The change is confined to read consistency level — no schema, import, or assertion logic was touched, so the expected-count checks remain the verification of record.
🤖 Generated with Claude Code