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

SolrCloudClient doesn't return 'adds' in Response when 'versions' is requested

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.4.1
    • Fix Version/s: 6.5, 7.0
    • Component/s: SolrJ
    • Security Level: Public (Default Security Level. Issues are Public)

      Description

      Hello,

      On our project we run Solr 4.2 but we're migrating to latest SolrCloud.
      We use optimistic locking, and when we post new documents we directly ask the version with the "versions" parameter. The response is in a "adds" field.
      I can't even find a doc explaining that but it works

      With Solr 5 (we did a few tests some time ago), 6.2 and 6.4.1 the Solr response has these "adds" but they're lost by the SolrJ client when aggregating responses from different Shards.

      I have a patch that I'll propose via Github.

      1. SOLR-10250.patch
        5 kB
        Ishan Chattopadhyaya
      2. SOLR-10250.patch
        5 kB
        Boris Naguet

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user BorisNaguet opened a pull request:

          https://github.com/apache/lucene-solr/pull/164

          SOLR-10250: SolrCloudClient doesn't return 'adds' in Response when' versions' is requested

          SolrCloudClient doesn't return 'adds' in Response when' versions' is requested

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/BorisNaguet/lucene-solr SOLR-10250-versions-adds

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/lucene-solr/pull/164.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #164


          commit 99bc8fa1c8ae6666996426afc9521e7604a1234c
          Author: Boris Naguet <boris.naguet@worldline.com>
          Date: 2017-03-08T17:37:46Z

          SOLR-10250: SolrCloudClient doesn't return 'adds' in Response when
          'versions' is requested


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user BorisNaguet opened a pull request: https://github.com/apache/lucene-solr/pull/164 SOLR-10250 : SolrCloudClient doesn't return 'adds' in Response when' versions' is requested SolrCloudClient doesn't return 'adds' in Response when' versions' is requested You can merge this pull request into a Git repository by running: $ git pull https://github.com/BorisNaguet/lucene-solr SOLR-10250 -versions-adds Alternatively you can review and apply these changes as the patch at: https://github.com/apache/lucene-solr/pull/164.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #164 commit 99bc8fa1c8ae6666996426afc9521e7604a1234c Author: Boris Naguet <boris.naguet@worldline.com> Date: 2017-03-08T17:37:46Z SOLR-10250 : SolrCloudClient doesn't return 'adds' in Response when 'versions' is requested
          Hide
          hossman Hoss Man added a comment -

          linking to SOLR-8733,

          Note that SolrCloudClient agregating responses from multiple leaders is only part of the problem – if an update is internally forwarded (either due ot updates being sent to nodes arbitrarily, or because of leader election while in transit) then the version# will also be missing.

          Show
          hossman Hoss Man added a comment - linking to SOLR-8733 , Note that SolrCloudClient agregating responses from multiple leaders is only part of the problem – if an update is internally forwarded (either due ot updates being sent to nodes arbitrarily, or because of leader election while in transit) then the version# will also be missing.
          Hide
          BorisNaguet Boris Naguet added a comment - - edited

          Thanks for feedback

          OK, I'm currently using .sendUpdatesOnlyToShardLeaders().sendDirectUpdatesToShardLeadersOnly() on SolrJ (though I'm not sure about it) but there's still the leader election possibility...

          Any reason it's been opened for so long?
          Not a widely used/recommanded usage?

          We're totally depending on that in our platform... but of course we can still make a "GET after POST" when it's not returned

          Show
          BorisNaguet Boris Naguet added a comment - - edited Thanks for feedback OK, I'm currently using .sendUpdatesOnlyToShardLeaders().sendDirectUpdatesToShardLeadersOnly() on SolrJ (though I'm not sure about it) but there's still the leader election possibility... Any reason it's been opened for so long? Not a widely used/recommanded usage? We're totally depending on that in our platform... but of course we can still make a "GET after POST" when it's not returned
          Hide
          hossman Hoss Man added a comment -

          Thanks for feedback

          Boris: I'm sorry, I wasn't giving you feedback on your patch – i was just triaging/linking the issues, and wanted to make sure people reading them realized that just fixing SolrCloudClient is only part of the problem.

          Any reason it's been opened for so long?

          just a question of people having time to dig into it and write up a patch ... it's probably not the sort of thing many people rely on, or if they do then (like you) they aren't using it with solr cloud – or it was easier (for their purposes) to work around with an RTG then to dig into solr to help with a fix.

          Show
          hossman Hoss Man added a comment - Thanks for feedback Boris: I'm sorry, I wasn't giving you feedback on your patch – i was just triaging/linking the issues, and wanted to make sure people reading them realized that just fixing SolrCloudClient is only part of the problem. Any reason it's been opened for so long? just a question of people having time to dig into it and write up a patch ... it's probably not the sort of thing many people rely on, or if they do then (like you) they aren't using it with solr cloud – or it was easier (for their purposes) to work around with an RTG then to dig into solr to help with a fix.
          Hide
          erickerickson Erick Erickson added a comment -

          I try to encourage patches as they preserve the history in a single place that stays here forever. An external repo can always go away.

          Show
          erickerickson Erick Erickson added a comment - I try to encourage patches as they preserve the history in a single place that stays here forever. An external repo can always go away.
          Hide
          BorisNaguet Boris Naguet added a comment -

          Here is the patch (just thinking, what is the use of Github PR in this case?)

          Show
          BorisNaguet Boris Naguet added a comment - Here is the patch (just thinking, what is the use of Github PR in this case?)
          Hide
          ichattopadhyaya Ishan Chattopadhyaya added a comment -

          Updating the patch with support for "deletes" and "deleteByQuery" versions as well, apart from "adds".

          Show
          ichattopadhyaya Ishan Chattopadhyaya added a comment - Updating the patch with support for "deletes" and "deleteByQuery" versions as well, apart from "adds".
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit ceffbf98445065220dcc9380e2731fd26a467f5d in lucene-solr's branch refs/heads/master from Ishan Chattopadhyaya
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ceffbf9 ]

          SOLR-10250: CloudSolrClient can now return versions for documents added or deleted when versions=true is passed

          Show
          jira-bot ASF subversion and git services added a comment - Commit ceffbf98445065220dcc9380e2731fd26a467f5d in lucene-solr's branch refs/heads/master from Ishan Chattopadhyaya [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ceffbf9 ] SOLR-10250 : CloudSolrClient can now return versions for documents added or deleted when versions=true is passed
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 659882790ac4213036b45242b58fceb2f33f2b43 in lucene-solr's branch refs/heads/branch_6x from Ishan Chattopadhyaya
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6598827 ]

          SOLR-10250: CloudSolrClient can now return versions for documents added or deleted when versions=true is passed

          Show
          jira-bot ASF subversion and git services added a comment - Commit 659882790ac4213036b45242b58fceb2f33f2b43 in lucene-solr's branch refs/heads/branch_6x from Ishan Chattopadhyaya [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6598827 ] SOLR-10250 : CloudSolrClient can now return versions for documents added or deleted when versions=true is passed
          Hide
          ichattopadhyaya Ishan Chattopadhyaya added a comment -

          Note that SolrCloudClient agregating responses from multiple leaders is only part of the problem – if an update is internally forwarded (either due ot updates being sent to nodes arbitrarily, or because of leader election while in transit) then the version# will also be missing.

          These issues are still unresolved, and can be tackled as part of SOLR-8733. This issue fixes the returning the versions part, whenever available.

          Thanks Boris Naguet!

          Show
          ichattopadhyaya Ishan Chattopadhyaya added a comment - Note that SolrCloudClient agregating responses from multiple leaders is only part of the problem – if an update is internally forwarded (either due ot updates being sent to nodes arbitrarily, or because of leader election while in transit) then the version# will also be missing. These issues are still unresolved, and can be tackled as part of SOLR-8733 . This issue fixes the returning the versions part, whenever available. Thanks Boris Naguet !

            People

            • Assignee:
              ichattopadhyaya Ishan Chattopadhyaya
              Reporter:
              BorisNaguet Boris Naguet
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development