← Back to Pull requests

SOLR-18656: Report a stalled update stream as an error for its node #5330

Merged
sarkaramrit1993 merged 3 files (68 lines) on Dec 02, 2026 18:17 UTC
View on GitHub
sarkaramrit1993 sarkaramrit1993 commented on Nov 13, 2026 05:24 UTC
Author

🤖 Generated with Claude

https://issues.apache.org/jira/browse/SOLR-18656

Description

When one replica's update stream stalls with updates still queued, StreamingSolrClients.blockUntilFinished() throws and SolrCmdDistributor.finish() only logs it. Retries are skipped and errors already collected from other replicas are dropped, so the leader returns success and failed replicas aren't put into a lower term.

Solution

Catch the stall per client and report it through that client's handleError. The other clients are still waited on and retried. DBQ and commit used to fail the whole request on a stall; they now record an error for that node.

A stream that stalls after its queue is drained isn't changed: stall detection needs a non-empty queue, so that still waits for the socket timeout.

Tests

SolrCmdDistributorTest.testStallKeepsErrorsFromOtherNodes: one node never reads, another refuses. On main getErrors() is empty.

Related: SOLR-5939 / #5075 touches the same error path.

Diff: 68 lines (+66 / -2) across 3 files Reviewer: dsmiley Review duration: 28132m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.36) × (1 − Review Confidence (0.93)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 68 lines diff across 3 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.94 · 4 substantive comment(s)
0.94
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
92%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.253
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
6 items
github-actions[bot] github-actions[bot] commented on Nov 13, 2026 05:25 UTC
Bot

Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes).

  • ✅ Jira issue in title: already present

  • ✅ Changelog: type: fixed <!-- The change fixes a bug where a stalled update stream caused the leader to return success and drop errors from other replicas&#44; which is a user&#45;visible symptom of failed replication&#46;​ -->

  • ✅ Reference Guide update: not needed <!-- This is an internal error&#45;handling fix in StreamingSolrClients that does not introduce new parameters&#44; configuration&#44; or user&#45;facing API changes that require Reference Guide documentation&#46;​ -->

  • ✅ Upgrade notes: not needed <!-- The change is a bug fix that improves error reporting and does not remove or rename any parameters&#44; APIs&#44; or configuration elements&#44; nor does it change defaults in a backwards&#45;incompatible way&#46;​ -->

  • ✅ Tests: included <!-- The PR modifies non&#45;trivial production logic in StreamingSolrClients&#46;​blockUntilFinished&#40;&#41; to handle IOExceptions per client&#44; which warrants new or changed tests to verify the error handling behavior&#46;​ -->
  • <!-- Assessed commit eedcb534aca361be5bad5c56f1b2d3002eea855f -->

    sarkaramrit1993 sarkaramrit1993 commented on Nov 24, 2026 00:38 UTC
    Author

    @dsmiley @gerlowskija @serhiy-bzhezytskyy, adding you as reviewers since you know StreamingSolrClients and the ConcurrentUpdate* clients best. This makes a stalled update stream report as an error for its node instead of hanging quietly. Thanks for taking a look whenever you have time.

    dsmiley dsmiley commented on code on Nov 24, 2026 03:44 UTC
    Code Review
    solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java:1
    @@ -94,7 +94,11 @@ public synchronized SolrClient getSolrClient(final SolrCmdDistributor.Req req) {
     
       public synchronized void blockUntilFinished() throws IOException {

    then does it still throw IOException?

    dsmiley dsmiley approved these changes on Nov 24, 2026 03:45 UTC
    Approved Reviewer

    Nice!

    sarkaramrit1993 sarkaramrit1993 commented on code on Nov 24, 2026 06:12 UTC
    Code Review
    solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java:1
    @@ -94,7 +94,11 @@ public synchronized SolrClient getSolrClient(final SolrCmdDistributor.Req req) {
     
       public synchronized void blockUntilFinished() throws IOException {

    Thanks @dsmiley, it doesn't anymore. Dropped it, and merged main.

    Reviewers
    Assignees
    sarkaramrit1993 sarkaramrit1993
    Labels
    risk: low confidence: 92.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.2% (MEDIUM) · Higher = larger blast radius
    36.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 92.7% · Lower = rushed or shallow review
    92.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 2.6% · Safe to merge
    2.6%
    Repository