Repository navigation
SOLR-8009: An unrouted id on an implicit-router collection is now sent to every shard - #5141
Open
nick-boss-tech wants to merge 8 commits into
Open
nick-boss-tech wants to merge 8 commits into
nick-boss-tech wants to merge 8 commits into
Conversation
Hypothetical, unrun regression test; see SOLR-8009-TESTING.md.
…icit router The fallback fired for any router that returns no target slice. A compositeId router with a router field also returns null when no _route_ is given, and there returning no documents is deliberate: testRTGCompositeRouterWithRouterField pins it. Only the implicit router has no routing information at all in that case, so only its unrouted ids are searched on all shards.
…ck, and test a routed miss
… real-time get test
nick-boss-tech
marked this pull request as ready for review
October 16, 2026 06:47
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)
https://issues.apache.org/jira/browse/SOLR-8009
What happens today
A real-time get with no
_route_finds nothing on an implicit-router collection, even when the document is stored.On a collection that uses the implicit router,
/get?id=<id>with no_route_and noshardsparameter returns no document. The distributed path inRealTimeGetComponent.createSubRequestsasks the router for a slice for each id. The implicit router returns no slice when there is no route, and the code skips the id (base code). The Jira report describes a NullPointerException on an older release. On this base the request returns an empty result with no error.What this change does
An unrouted id on an implicit-router collection is now sent to every shard.
_route_was given (RealTimeGetComponent.java).shardsis given (RealTimeGetComponent.java at the base commit).Proof
FullSolrCloudDistribCmdsTest.testRealTimeGetImplicitRouterWithoutRoutefails on the base code and passes with this change.14c7aac0d15, the firstassertNotNullfails because the get returns nothing.e600375aaee3: FullSolrCloudDistribCmdsTest 10 of 10; TestRealTimeGet 4 of 4; TestRandomFlRTGCloud 2 of 2; TestAddFieldRealTimeGet 1 of 1. All pass. The class also passes at the previous head8795661ddc98with these tests, because a route naming a real shard resolves to that shard there as well; the base-code failure above is what the change is measured against.A choice to check
An unrouted get on an implicit collection fans out to every shard. The other option was to fail it.
_route_orshards. Callers that now get an empty result would get an error instead.Was fanning out the right call here, or should an unrouted get fail?
Limits
Duplicate results and compositeId collections with no route are not fixed here, and two cases have no test.
shardsform does the same, as SOLR-8954 reports. This change does not fix it._route_still returns nothing, as before. I can open a follow-up ticket and PR for those on request._route_that names no slice of the collection is not tested. That is the one case where the new no-route condition changes the outcome: without it the id would be sent to every shard.Changelog: changelog/unreleased/SOLR-8009-rtg-implicit-router.yml
AI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.