Currently, I see that code flow for a query in SolrCloud is as follows:
For distributed query:
SolrCore -> SearchHandler.handleRequestBody() -> HttpShardHandler.submit()
For non-distributed query:
SolrCore -> SearchHandler.handleRequestBody() -> QueryComponent.process()
For a distributed query, the request is always sent to all the shards even if the originating SolrCore (handling the original distributed query) is a replica of one of the shards.
If the original Solr-Core can check itself before sending http requests for any shard, we can probably save some network hopping and gain some performance.
We can change SearchHandler.handleRequestBody() or HttpShardHandler.submit() to fix this behavior (most likely the former and not the latter).
- is required by
SOLR-8298 small preferLocalShards implementation refactor
- relates to
SOLR-9758 refactor preferLocalShards implementation
SOLR-14035 remove deprecated preferLocalShards references