Solr
  1. Solr
  2. SOLR-893

Unable to delete documents via SQL and deletedPkQuery with deltaimport

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.4
    • Labels:
      None

      Description

      DocBuilder calls entityProcessor.nextModifiedRowKey which sets up rowIterator for the modified rows, but when it comes time to call entityProcessor.nextDeletedRowKey, this is skipped as although no rows are returned from nextModifiedRowKey, rowIterator in SqlEntityProcessor.java is still not null

      1. SOLR-893.patch
        6 kB
        Dan Rosher
      2. SOLR-893.patch
        6 kB
        Dan Rosher
      3. SOLR-893.patch
        4 kB
        Dan Rosher

        Activity

        Hide
        Dan Rosher added a comment -

        If there are no rows to fetch from the datasource, then null the rowIterator .. this ensure that e.g. the query for nextDeletedRowKey can be subsequently run.

        Also a test case added for deleting rows during a delta import added

        Show
        Dan Rosher added a comment - If there are no rows to fetch from the datasource, then null the rowIterator .. this ensure that e.g. the query for nextDeletedRowKey can be subsequently run. Also a test case added for deleting rows during a delta import added
        Hide
        Noble Paul added a comment -

        instead of adding the check in each method it can be added to the getNext() method

        as follows

            if (rowIterator.hasNext())
                return rowIterator.next();
              query = null;
              rowIterator = null;
              return null;
        
        Show
        Noble Paul added a comment - instead of adding the check in each method it can be added to the getNext() method as follows if (rowIterator.hasNext()) return rowIterator.next(); query = null ; rowIterator = null ; return null ;
        Hide
        Dan Rosher added a comment - - edited

        Thanks Noble ... I've made that change ... additionally I've noticed that during any particular delta import you might have both and update/create AND a delete, the current code would not honor the delete hence I've added something to cater for this, and updated the test to confirm.

        Show
        Dan Rosher added a comment - - edited Thanks Noble ... I've made that change ... additionally I've noticed that during any particular delta import you might have both and update/create AND a delete, the current code would not honor the delete hence I've added something to cater for this, and updated the test to confirm.
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks for the patch Dan.

        if(modifiedRow.get(entity.pk) == row.get(entity.pk)){
        

        Wouldn't this need an equals check?

        Show
        Shalin Shekhar Mangar added a comment - Thanks for the patch Dan. if (modifiedRow.get(entity.pk) == row.get(entity.pk)){ Wouldn't this need an equals check?
        Hide
        Dan Rosher added a comment -

        Ah yes thanks Shalin, == is now '.equals'

        Show
        Dan Rosher added a comment - Ah yes thanks Shalin, == is now '.equals'
        Hide
        Shalin Shekhar Mangar added a comment -

        Committed revision 723824.

        Thanks Dan!

        Show
        Shalin Shekhar Mangar added a comment - Committed revision 723824. Thanks Dan!
        Hide
        Grant Ingersoll added a comment -

        Bulk close for Solr 1.4

        Show
        Grant Ingersoll added a comment - Bulk close for Solr 1.4

          People

          • Assignee:
            Shalin Shekhar Mangar
            Reporter:
            Dan Rosher
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development