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

LBHttpSolrClient.request can return incorrect Rsp.server string

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      Problem:

      • LBHttpSolrClient.request assigns to rsp.server at line 361 and then at line 366 makes a doRequest(client, req, rsp, isUpdate, false, null); method call.
      • If the original doRequest call(s) did not succeed then later at line 382 additional doRequest calls may happen. These calls could use a different server but currently rsp.server remains unchanged and thus LBHttpSolrClient.request could return an incorrect Rsp.server string value.

      Proposed fix:

      • Change the doRequest method so that it assigns Rsp.server alongside the existing Rsp.rsp assignment.
      • Note that since the HttpSolrClient constructor trims of any trailing / from the baseUrl then the proposed fix potentially minutely changes the Rsp.getServer() return value.
        • Rsp.getServer() is called by HttpShardHandler.submit as srsp.setShardAddress(rsp.getServer());
        • I have not fully checked where/how getShardAddress() is then subsequently used but would very much hope that the removal of a trailing / would not cause any issues.
      1. SOLR-9391.patch
        4 kB
        Christine Poerschke

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 250a867de268b597b840cc38c4d6fe465d54a511 in lucene-solr's branch refs/heads/master from Christine Poerschke
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=250a867 ]

        SOLR-9391: LBHttpSolrClient.request now correctly returns Rsp.server when previously skipped servers were successfully tried.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 250a867de268b597b840cc38c4d6fe465d54a511 in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=250a867 ] SOLR-9391 : LBHttpSolrClient.request now correctly returns Rsp.server when previously skipped servers were successfully tried.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 9a5dcce5de61be427adce43e4d03642484a78a5a in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9a5dcce ]

        SOLR-9391: LBHttpSolrClient.request now correctly returns Rsp.server when previously skipped servers were successfully tried.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 9a5dcce5de61be427adce43e4d03642484a78a5a in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9a5dcce ] SOLR-9391 : LBHttpSolrClient.request now correctly returns Rsp.server when previously skipped servers were successfully tried.

          People

          • Assignee:
            cpoerschke Christine Poerschke
            Reporter:
            cpoerschke Christine Poerschke
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development