Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13257

Enable replica routing affinity for better cache usage

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: master (9.0), 8.3
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      For each shard in a distributed request, Solr currently routes each request randomly via ShufflingReplicaListTransformer to a particular replica. In setups with replication factor >1, this normally results in a situation where subsequent requests (which one would hope/expect to leverage cached results from previous related requests) end up getting routed to a replica that hasn't seen any related requests.

      The problem can be replicated by issuing a relatively expensive query (maybe containing common terms?). The first request initializes the queryResultCache on the consulted replicas. If replication factor >1 and there are a sufficient number of shards, subsequent requests will likely be routed to at least one replica that hasn't seen the query before. The replicas with uninitialized caches become a bottleneck, and from the client's perspective, many subsequent requests appear not to benefit from caching at all.

        Attachments

        1. AffinityShardHandlerFactory.java
          5 kB
          Michael Gibney
        2. SOLR-13257.patch
          35 kB
          Michael Gibney
        3. SOLR-13257.patch
          35 kB
          Jan Høydahl

          Issue Links

            Activity

              People

              • Assignee:
                anshum Anshum Gupta
                Reporter:
                mgibney Michael Gibney
              • Votes:
                1 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 5h
                  5h