SOLR-18474: InternalSolrClientCache separate from SolrClientCache #4934
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 369 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.354
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4934"
general
weight: 0.35
sigram
https://issues.apache.org/jira/browse/SOLR-18474
Description
SolrClientCacheis a SolrJ class meant for client use, yet Solr uses it server-side for streaming expressions,/export,/graph,/sqland the cross-collection join. Inside Solr its ownership was diffuse:CoreContainerheld one, and several streams quietly created their own when theirStreamContexthad none. Those instances differ in configuration and none of them knows which cluster is the local one.Solution
Add
InternalSolrClientCache(inorg.apache.solr.cloud), the onlySolrClientCachepermitted inside a Solr server:ZkControllerowns it and closes it.CoreContainerno longer holds one.StreamHandler,ExportHandler,GraphHandlerandCrossCollectionJoinQueryget it from there.The local cluster's
CloudSolrClientis created once, reusing the node's HTTP client and its ZooKeeper ACLs. Connections to any other cluster get a separate client and must be permitted byallowZkHosts(ZooKeeper) orallowUrls(HTTP), viaZkController.validateSolrConnection. This replaces the all-or-nothingsolr.cloud.external.enabledflag from the earlier revision of this branch.Constructing a plain
SolrClientCacheon a Solr server thread now fails fast, so future server-side code uses the internal one. Client JVMs, including SolrJ applications andbin/solr stream --execution local, are unaffected.Fallouts of that guard, each its own commit:
CloudSolrStreamnow creates one cache on the calling thread and shares it with theSolrStreams it opens on pool threads, rather than each opening its own; and the Solr JDBC driver can accept a supplied cache.zkHost/solrConnectionforms build aCloudSolrClient, which standalone should not do; itssolrUrlform could work locally, but the remote end has to be SolrCloud anyway, and nothing tested it. A note to the dev list asks whether anyone relies on standalone reaching a cluster this way.Developed with AI assistance (Claude Code): merge-conflict resolution against
main, the validation wiring, and theCloudSolrStreamcache sharing, all reviewed by me.Checklist
mainbranch../gradlew check.🤖 Generated with Claude Code