Repository navigation
[Ready] SOLR-5735: Use a leaders-only client in the safe-leader chaos tests - #5208
Draft
nick-boss-tech wants to merge 1 commit into
Draft
nick-boss-tech wants to merge 1 commit into
nick-boss-tech wants to merge 1 commit into
Conversation
…s tests The monkey in these tests spares leaders only. A cloud client that sends updates to any replica can hit a replica the monkey just stopped, which fails the zero-failure check.
nick-boss-tech
marked this pull request as ready for review
October 23, 2026 19:52
nick-boss-tech
marked this pull request as draft
October 28, 2026 04:45
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.
🤖 AI text below 🤖 (reviewed by Nick Shanin)
Ready for review, but held as a draft due to the project's open-PR cap; I'll mark it open on request.
A safe-leader test fails when the client sends an update to a replica the monkey stops.
ChaosMonkeySafeLeaderTestandChaosMonkeySafeLeaderWithPullReplicasTeststop replicas but spare leaders, then assert that no update failed (line 209). The cloud client in these tests is built with a random choice between sending updates to shard leaders only and sending them to any replica (line 370). In the second mode an update can go to a pull replica, and the monkey can stop that node while the request is in flight. The request then fails withClosedChannelExceptionand the check reportsexpected:<0> but was:<1>. On main with seedE4EFD2B86C0B81D4on local disk, adeleteByIdsent tocollection1_shard1_replica_p11failed 4 ms after the monkey stopped that node.The safe-leader tests now use a leaders-only client. Both tests override
createCloudClientto build the client withshardLeadersOnlyset. Leaders are the one kind of node these tests never stop, so an update that fails now is a real failure. Nothing else changes. The NothingIsSafe tests keep the random client.Proof. The failure is a timing race, so no single run fails on main. Forcing the any-replica client in
ChaosMonkeySafeLeaderWithPullReplicasTestfailed 1 of 4 random runs ofChaosMonkeySafeLeaderWithPullReplicasTestwithexpected:<0> but was:<1>. Its failed request was an update tocollection1_shard1_replica_p14, a pull replica. With the leaders-only client (compare, head 60eb0e7), 8 runs of the two tests passed:ChaosMonkeySafeLeaderWithPullReplicasTestthree times with the seed above and three times with random seeds, andChaosMonkeySafeLeaderTesttwice with random seeds. Nightly tests on, local disk, 2026-10-23. The runs were repeated on a second host and file system: 9 of 9 passed, including three runs ofChaosMonkeySafeLeaderWithPullReplicasTestat the seed above and three random-seed runs of each test. The full module check passes at the branch head.The choice. Three routes were available:
Context: the test name says leaders are safe, and a leader is the node every leaders-only update goes to. A retry on a non-idempotent update could apply it twice.
Ladder: Does the test promise no failed update? Yes, but only for updates sent to a node it spares. Is a failed update to a node the monkey stops a defect? No. Does the any-replica client lose coverage? The NothingIsSafe tests still run it, with a failure tolerance.
Recommendation: route 1. It keeps the zero-failure check strict, and it changes only the two tests that need it.
Limits. The safe-leader tests no longer send updates through a non-leader replica under chaos. Whether the client should retry an update that fails with
ClosedChannelExceptionis a separate question; a follow-up ticket can be opened on request. TheToo many linkserror that a network file system returned during an index copy (IndexFetcher line 1224) is not addressed. The timeout inChaosMonkeyNothingIsSafeWithPullReplicasTestappeared only on that file system.AI-generated description. Nick Shanin directed the work and takes responsibility for this contribution.