Repository navigation
[Ready] SOLR-18576: Wait for the expired ZooKeeper session before indexing in BasicDistributedZk2Test - #5206
Draft
nick-boss-tech wants to merge 3 commits into
Draft
nick-boss-tech wants to merge 3 commits into
nick-boss-tech wants to merge 3 commits into
Conversation
nick-boss-tech
force-pushed
the
solr-18576-submit-apache-main
branch
from
October 23, 2026 15:59
009498a to
4c8f12f
Compare
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 🤖 (posted on behalf of 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.
https://issues.apache.org/jira/browse/SOLR-18576
What happens today
BasicDistributedZk2Testcan index into a node whose ZooKeeper session has just expired, and the update fails with "Updates are disabled".After
ChaosMonkey.expireSessionreturns, the test callsblockUntilConnectedand then indexes (test lines 152-164 at the merge base).expireSessionreturns once the client reports disconnected or its session id changes, but the expired-session event reaches Curator later. The wait can return before the event arrives, so the update races the expiry. In a CI run on #5194, the update was rejected with 503 "Cannot talk to ZooKeeper - Updates are disabled" 4 ms after the session-expired event was logged and 7 ms after ChaosMonkey started the expiry.What this change does
The test waits for the expired-session event, then for reconnection, before it indexes.
A connection-state listener is registered before the session is expired. The test waits on a latch that counts down on the expired-session callback, then calls
blockUntilConnected, and removes the listener before indexing. OnlyBasicDistributedZk2Test.javachanges. Production code is unchanged.Proof
The proof is inconclusive by construction: the race did not reproduce before or after the change, so these runs show the test still passes, not that the CI failure is gone.
BasicDistributedZk2Test, seed7E5494314774A841(the seed from the failing run): 1 test, 0 failures, 0 errors. Verified 2026-10-23 at head4c8f12f526f.BasicDistributedZk2Test, 4 random seeds: 4 tests, 0 failures, 0 errors. Verified 2026-10-23 at head4c8f12f526f.:solr:core:check -x testpasses at that head.Limits
The race is timing-dependent, and the cause is inferred from the CI log, not confirmed by a failing run.
expireSessionare not changed.AI-generated description. Nick Shanin directed the work and takes responsibility for this contribution.