Solr
  1. Solr
  2. SOLR-3318

LBHttpSolrClient should allow to specify a preferred server for a query

    Details

    • Type: Improvement Improvement
    • Status: Reopened
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 6.3
    • Fix Version/s: None
    • Component/s: clients - java
    • Labels:
      None

      Description

      For a user query we make several solr queries that differ only slightly and therefore should use/reuse objects cached from the first query (we're using a custom request handler and custom caches).
      Thus such subsequent queries should hit the same solr server.

      The implemented solution looks like this:

      • The client obtains a live SolrServer from LBHttpSolrServer
      • The client provides this SolrServer as preferred server for a query
      • If the preferred server is no longer alive the request is retried on another live server
      • Everything else follows the existing logic:
        • After live servers are exhausted, any servers previously marked as dead will be tried before failing the request
        • If no live servers are found a SolrServerException is thrown

      The implementation is also on github.

      Mailing list thread: http://lucene.472066.n3.nabble.com/LBHttpSolrServer-to-query-a-preferred-server-tt3884140.html

      1. SOLR-3318.git.patch
        16 kB
        Martin Grotzke

        Activity

        Hide
        Martin Grotzke added a comment -

        Patch created from git changeset.

        Show
        Martin Grotzke added a comment - Patch created from git changeset.
        Hide
        Torsten Bøgh Köster added a comment -

        +1 on this one. To construct a response we run 2 solr queries, one for results one for facets. For caching purpuses it would be perfect to run those consecutive one on the same solr instance

        Show
        Torsten Bøgh Köster added a comment - +1 on this one. To construct a response we run 2 solr queries, one for results one for facets. For caching purpuses it would be perfect to run those consecutive one on the same solr instance
        Hide
        Martin Grotzke added a comment -

        Any feedback on this?

        Show
        Martin Grotzke added a comment - Any feedback on this?
        Hide
        Alexandre Rafalovitch added a comment -

        LBHttpSolrServer.java is no longer in the codebase. Is this issue still relevant?

        Show
        Alexandre Rafalovitch added a comment - LBHttpSolrServer.java is no longer in the codebase. Is this issue still relevant?
        Hide
        Alexandre Rafalovitch added a comment -

        No longer relevant issue, as the mentioned code is gone.

        Show
        Alexandre Rafalovitch added a comment - No longer relevant issue, as the mentioned code is gone.
        Hide
        Shalin Shekhar Mangar added a comment -

        Alexandre Rafalovitch – the code is not gone. It is renamed to LBHttpSolrClient.java which is internally used by CloudSolrClient. I think the issue is still valid.

        Show
        Shalin Shekhar Mangar added a comment - Alexandre Rafalovitch – the code is not gone. It is renamed to LBHttpSolrClient.java which is internally used by CloudSolrClient. I think the issue is still valid.
        Hide
        Alexandre Rafalovitch added a comment -

        [Shalin Shekhar Mangar Thanks for the catch. I reviewed the LBHttpSolrClient and I see no indication of server stickiness being implemented.

        Do you think it is a viable feature still? One that could be marked newdev, as it has a patch that needs to be adapted to master?

        Show
        Alexandre Rafalovitch added a comment - [ Shalin Shekhar Mangar Thanks for the catch. I reviewed the LBHttpSolrClient and I see no indication of server stickiness being implemented. Do you think it is a viable feature still? One that could be marked newdev, as it has a patch that needs to be adapted to master?
        Hide
        Shalin Shekhar Mangar added a comment -

        The idea of fixing servers for a query is valid but I'd do it differently in SolrCloud – see SOLR-8146 for a better idea of using snitches for routing.

        Show
        Shalin Shekhar Mangar added a comment - The idea of fixing servers for a query is valid but I'd do it differently in SolrCloud – see SOLR-8146 for a better idea of using snitches for routing.
        Hide
        Alexandre Rafalovitch added a comment -

        Still a valid issue as per Shalin Shekhar Mangar and relevant to the latest Solr (even if patch is not relevant)

        Show
        Alexandre Rafalovitch added a comment - Still a valid issue as per Shalin Shekhar Mangar and relevant to the latest Solr (even if patch is not relevant)

          People

          • Assignee:
            Unassigned
            Reporter:
            Martin Grotzke
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development