SOLR-18530: Route adds after the proxy cut in RecoveryAfterSoftCommitTest to the shard leaders first #5098
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.59) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #5098"
general
weight: 0.35
nick-boss-tech
🤖 AI text below 🤖 (posted on behalf of Nick Shanin)
https://issues.apache.org/jira/browse/SOLR-18530
What happens today
An add made after the test cuts off one replica can fail, and the test stops there.
RecoveryAfterSoftCommitTestcloses one replica's socket proxy, then adds more documents through the normal cloud client. That client can send an add to the cut replica. The add fails withSolrServerException: IOException occurred when talking to server at ..., and its cause is aClosedChannelException. The test fails before its recovery check.What this change does
After the cut, this test sends its adds to the shard leaders first.
The adds before the cut still use the normal client. The adds after it use a new client built to send updates to shard leaders first (test). Whether the leader is the only endpoint is set by the test helper's randomized
directUpdatesToLeadersOnlysetting, so the cut replica can remain on the list as a failover target. The leader is not cut, so the adds reach it in either setting. The leader still sends each add on to the cut replica: a failed send to a replica of this shard is logged and does not fail the add (DistributedZkUpdateProcessor, base commit). The error is returned to the client instead when the leader changed during the send (theLeaderChangedcase) (DistributedZkUpdateProcessor, base commit). The document count is unchanged, so the replica still misses more updates than its update log keeps.Our reading of the cause, which these runs do not prove: the cloud client still held a pooled connection to the cut replica's proxy. Endpoint failover in
LBSolrClientmoves an update to another endpoint only when it could not connect or the request was never sent (LBSolrClient, base commit). Once the update has reached the server, aClosedChannelExceptionis not one of the causes that makes the cloud client resend an update (CloudSolrClient, base commit).The change touches only this test. No product code changes.
Proof
This is a test-only change. The repeated runs pass, but they do not show that the change fixes the failure.
RecoveryAfterSoftCommitTestwith this change: 6 of 6 runs passed. Checked 2026-10-10 at 14868bc7a7f5ec5c4fa1ade5f894cbda9533307d.A choice to check
The adds after the cut use a leaders-first client, not a retry in the test.
The other option was to keep the normal client and retry the same add when it fails with
ClosedChannelException. That would keep any-replica writes during the partition in this test, which the leaders-first client removes. The existing testCheckRetryUnrollTestalready asserts thatClosedChannelExceptionis not retried (test, base commit), and changing that rule would be a separate decision.Was routing these adds through a leaders-first client the right call, or would you rather keep random routing and retry in the test?
Limits
The fix is not proven by these runs, and some neighboring cases are not covered.
directUpdatesToLeadersOnlyfor this client, so the cut replica can stay on the failover list; the leader is still tried first. Setting the flag explicitly would need a fresh set of runs, since the six passing runs used the randomized setting.ClosedChannelExceptionon an update once the update has reached the server. That is a separate product decision.Changelog: none. "Pull requests that only touch documentation, tests, build files or CI configuration are exempt and pass without an entry." (dev-docs/changelog.adoc, section 4)
AI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.
---
Related fixes for the Solr 10.1.0 RC3 smoke-test failures. The RC3 smoke tester failed repeatedly on a small set of tests; the fixes are: