Solr
  1. Solr
  2. SOLR-2492

DIH does not commit if only Deletes are processed

    Details

      Description

      If a DIH run processes deletes using the $deleteDocById and/or $deleteDocByQuery special commands, and if no adds or updates get processed in the same run, then "commit" is never called. Also, the # of deleted documents does not get incremented.

      1. SOLR-2492.patch
        2 kB
        Shalin Shekhar Mangar
      2. SOLR-2492.patch
        2 kB
        James Dyer
      3. SOLR-2492-branch3x.patch
        2 kB
        Shalin Shekhar Mangar

        Issue Links

          Activity

          Hide
          James Dyer added a comment -

          This patch increments the # deleted documents once for each call to $deleteDocById and/or $deleteDocByQuery. Note that it would be even better (especially with ..byQuery) to get the actual # of deleted documents and increment by that many.

          By incrementing the # deleted documents, "commit" is called at the end of the run as expected. This fixes the issue of commit not being called and also causes the # of deleted documents to be reported back to the user. While this is better than current behavior, the actual # of reported deletions may not be accurate because a call to $deleteDocById may not actually delete a document. Likewise a call to $deleteDocByQuery could delete more than 1 document (or none).

          A unit test is provided.

          Show
          James Dyer added a comment - This patch increments the # deleted documents once for each call to $deleteDocById and/or $deleteDocByQuery. Note that it would be even better (especially with ..byQuery) to get the actual # of deleted documents and increment by that many. By incrementing the # deleted documents, "commit" is called at the end of the run as expected. This fixes the issue of commit not being called and also causes the # of deleted documents to be reported back to the user. While this is better than current behavior, the actual # of reported deletions may not be accurate because a call to $deleteDocById may not actually delete a document. Likewise a call to $deleteDocByQuery could delete more than 1 document (or none). A unit test is provided.
          Hide
          Robert Muir added a comment -

          Bulk move 3.2 -> 3.3

          Show
          Robert Muir added a comment - Bulk move 3.2 -> 3.3
          Hide
          Shalin Shekhar Mangar added a comment -

          Patch updated to trunk.

          Show
          Shalin Shekhar Mangar added a comment - Patch updated to trunk.
          Hide
          Shalin Shekhar Mangar added a comment -

          Patch for branch_3x

          Show
          Shalin Shekhar Mangar added a comment - Patch for branch_3x
          Hide
          Shalin Shekhar Mangar added a comment -

          Committed revision 1145925 on trunk and 1145928 on branch_3x.

          Thanks James!

          Show
          Shalin Shekhar Mangar added a comment - Committed revision 1145925 on trunk and 1145928 on branch_3x. Thanks James!
          Hide
          James Dyer added a comment -

          Thank you, Shalin! I also updated the wiki with a note about commits / increments and the pre-3.4 vs post-3.4 behavior.

          Show
          James Dyer added a comment - Thank you, Shalin! I also updated the wiki with a note about commits / increments and the pre-3.4 vs post-3.4 behavior.
          Hide
          Robert Muir added a comment -

          bulk close for 3.4

          Show
          Robert Muir added a comment - bulk close for 3.4

            People

            • Assignee:
              Shalin Shekhar Mangar
              Reporter:
              James Dyer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development