← Back to Pull requests

SOLR-18446: Keep collection routing path-scoped in HttpSolrCall #5202

Open
unknown opened this pull request with 512 lines diff across 6 files
View on GitHub
unknown unknown commented on Oct 23, 2026 05:05 UTC
Author

🤖 AI text below 🤖 (posted on behalf of Nick Shanin)

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

What happens today

When a request carries a collection parameter that disagrees with the collection named in the URL path, HttpSolrCall routes by the parameter, so the request can be served by a collection it was not addressed to.

HttpSolrCall at the base resolves the request's collection with the collection parameter taking precedence over the path. The ticket states the rule this violates: the URL path alone should govern which collection receives a collection-scoped request.

What this change does

The URL path decides the collection, on the v1 and the V2 entry paths alike; the collection parameter no longer overrides the path the request was sent to.

HttpSolrCall.java takes the collection from the path, and V2HttpCall.java now resolves the collection from its path segment instead of the parameter. HttpSolrCallCloudTest covers the v1 disagreement case, the narrowing case, and the V2 disagreement case. Four existing tests that relied on the parameter winning (BasicDistributedZkTest, TestDistribIDF, RuleBasedAuthorizationCoreCollectionTest, DistributedQueryComponentOptimizationTest) now put their collections in the path, and AliasIntegrationTest keeps a case where a CloudSolrClient carries the collection only as a parameter, which the client moves into the path. The Ref Guide's distributed-requests page now describes the parameter as narrowing the path, and the Solr 11 major-changes page records the removal. Eleven files change, including the changelog entry.

Proof

The new V2 coverage failed before its fix and passes at this head; the checks below ran on this exact tree, verified 2026-10-22.

  • Before the V2 fix, the new V2 case failed with expected:<[collection1]> but was:<[collection2]> (the parameter winning on the V2 path); the other four HttpSolrCallCloudTest tests passed.

  • At this head, seed 18446: HttpSolrCallCloudTest 5 run, AliasIntegrationTest 9 run, BasicDistributedZkTest 1 run (its monolithic test, including the multi-collection section), and one multi-collection method each in TestDistribIDF, RuleBasedAuthorizationCoreCollectionTest, and DistributedQueryComponentOptimizationTest: 18 run, 0 skipped, 0 failures.

  • The changelog entry parses, the Error Prone compile passes, and :solr:core:check -x test passes.
  • Limits

    Requests whose parameter matches their path route as before. Three cases change: a parameter that disagrees with the path, a request with no collection in the path, and a multi-collection path with a non-matching parameter.

  • The precedence change is deliberate and is what the ticket asks for. A client that relied on overriding the path with the collection parameter will now be routed by the path.

  • A request with no collection segment in the path, such as /solr/select?collection=c1, now returns 404 instead of routing by the parameter.

  • When the path names several collections (an alias or a comma list), the parameter only narrows the list; a parameter that matches none of them is ignored and the request goes to all of them.
  • Changelog: changelog/unreleased/SOLR-18446-path-controls-collection-routing.yml

    AI-generated description. Nick Shanin directed the work and takes responsibility for this contribution.

    Diff: 512 lines (+384 / -128) across 6 files Reviewer: nick-boss-tech Review duration: 55632m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.55) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 512 lines diff across 6 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    40%
    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.373
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #5202"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 40.9% 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: 54.6% (MEDIUM) · Higher = larger blast radius
    54.6%
    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: 40.9% · Lower = rushed or shallow review
    40.9%
    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: 32.3% · Safe to merge
    32.3%
    Repository