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

solrj CloudSolrClient: add directUpdatesToLeadersOnly support

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2, 7.0
    • Component/s: SolrJ
    • Labels:
      None

      Description

      solrj CloudSolrClient: add directUpdatesToLeadersOnly support

      (Marvin Justice, Christine Poerschke)

      Proposed change:

      • Addition of a directUpdatesToLeadersOnly flag to allow clients to request that direct updates be sent to the shard leaders and only to the shard leaders.

      Motivation:

      • In a scenario where there is temporarily no shard leader the update request will 'fail fast' allowing the client to handle retry logic.

      Related tickets:

      • SOLR-6312 concerns the ((currently) no longer used) updatesToLeaders flag. The updatesToLeaders logic however appears to be slightly different from the proposed directUpdatesToLeadersOnly logic: updatesToLeaders indicates that sending to leaders is preferred but not mandatory whereas directUpdatesToLeadersOnly mandates sending to leaders only.
      1. SOLR-9090.patch
        19 kB
        Christine Poerschke
      2. SOLR-9090.patch
        19 kB
        Christine Poerschke

        Issue Links

          Activity

          Hide
          cpoerschke Christine Poerschke added a comment -

          Attaching proposed patch against master.

          Show
          cpoerschke Christine Poerschke added a comment - Attaching proposed patch against master.
          Hide
          cpoerschke Christine Poerschke added a comment -

          Linking SOLR-6312 as related but slightly different logic.

          Show
          cpoerschke Christine Poerschke added a comment - Linking SOLR-6312 as related but slightly different logic.
          Hide
          cpoerschke Christine Poerschke added a comment -

          Refreshed patch file (adding solr/CHANGES.txt entry), with a view towards committing the change towards the end of this or beginning of next week. Questions, comments, reviews etc. welcome as usual. Thank you.

          Show
          cpoerschke Christine Poerschke added a comment - Refreshed patch file (adding solr/CHANGES.txt entry), with a view towards committing the change towards the end of this or beginning of next week. Questions, comments, reviews etc. welcome as usual. Thank you.
          Hide
          jira-bot ASF subversion and git services added a comment -

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

          SOLR-9090: Add directUpdatesToLeadersOnly flag to solrj CloudSolrClient. (Marvin Justice, Christine Poerschke)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 976079a8ee8a2cff1c8df01ae9f2856b3ddcdac3 in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=976079a ] SOLR-9090 : Add directUpdatesToLeadersOnly flag to solrj CloudSolrClient. (Marvin Justice, Christine Poerschke)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 85c8f22ca9aa89a76940641e19da2a688e1a0796 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=85c8f22 ]

          SOLR-9090: Add directUpdatesToLeadersOnly flag to solrj CloudSolrClient. (Marvin Justice, Christine Poerschke)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 85c8f22ca9aa89a76940641e19da2a688e1a0796 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=85c8f22 ] SOLR-9090 : Add directUpdatesToLeadersOnly flag to solrj CloudSolrClient. (Marvin Justice, Christine Poerschke)
          Hide
          varunthacker Varun Thacker added a comment -

          Hi Christine,

          Just curious - Why shouldn't directUpdatesToLeadersOnly be the default behaviour?

          If at a time of an update there are no leaders then won't the request fail anyways?

          Show
          varunthacker Varun Thacker added a comment - Hi Christine, Just curious - Why shouldn't directUpdatesToLeadersOnly be the default behaviour? If at a time of an update there are no leaders then won't the request fail anyways?
          Hide
          Marvin Justice Marvin Justice added a comment -

          If it's a transient condition, and the request is passed off to a non-leader, then it may succeed if a leader suddenly reappears.

          Show
          Marvin Justice Marvin Justice added a comment - If it's a transient condition, and the request is passed off to a non-leader, then it may succeed if a leader suddenly reappears.
          Hide
          mikemccand Michael McCandless added a comment -

          Bulk close resolved issues after 6.2.0 release.

          Show
          mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.
          Hide
          shalinmangar Shalin Shekhar Mangar added a comment -

          Sorry for being late here but I think directUpdatesToLeadersOnly should be the default. There is little advantage in sending requests to other nodes in the hope that even if we didn't see a leader, someone else might.

          Show
          shalinmangar Shalin Shekhar Mangar added a comment - Sorry for being late here but I think directUpdatesToLeadersOnly should be the default. There is little advantage in sending requests to other nodes in the hope that even if we didn't see a leader, someone else might.
          Hide
          cpoerschke Christine Poerschke added a comment -

          For the newly added directUpdatesToLeadersOnly flag to initially default to existing behaviour made sense I think. However, now that it's no longer a new flag then, sure, its default value could be changed, SOLR-9464 created with proposed patch.

          Show
          cpoerschke Christine Poerschke added a comment - For the newly added directUpdatesToLeadersOnly flag to initially default to existing behaviour made sense I think. However, now that it's no longer a new flag then, sure, its default value could be changed, SOLR-9464 created with proposed patch.
          Hide
          dsmiley David Smiley added a comment -

          Christine Poerschke I'm looking at SolrTestCaseJ4.CloudSolrClientBuilder. Instead of the somewhat complicated tracking using configuredDUTflag, couldn't you simply remove all that stuff and just modify the builder's constructor to randomize the settings?

          Show
          dsmiley David Smiley added a comment - Christine Poerschke I'm looking at SolrTestCaseJ4.CloudSolrClientBuilder . Instead of the somewhat complicated tracking using configuredDUTflag, couldn't you simply remove all that stuff and just modify the builder's constructor to randomize the settings?
          Hide
          dsmiley David Smiley added a comment -

          Furthermore, shouldn't shardLeadersOnly be randomized as well?

          Show
          dsmiley David Smiley added a comment - Furthermore, shouldn't shardLeadersOnly be randomized as well?
          Hide
          cpoerschke Christine Poerschke added a comment -

          David Smiley - yes, I think so and created SOLR-11507 with patch of how i understood your suggestions.

          Show
          cpoerschke Christine Poerschke added a comment - David Smiley - yes, I think so and created SOLR-11507 with patch of how i understood your suggestions.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development