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

Unable to delete documents via SQL and deletedPkQuery with deltaimport

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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
        rosher 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
        rosher 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 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 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
        rosher 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
        rosher 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
        shalinmangar 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
        shalinmangar 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
        rosher Dan Rosher added a comment -

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

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

        Committed revision 723824.

        Thanks Dan!

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

        Bulk close for Solr 1.4

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development