Solr
  1. Solr
  2. SOLR-1141

Fix NPE during creating snapshot and clean up code

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.4
    • Component/s: replication (java)
    • Labels:
      None

      Description

      If there is no new document added since the last snapshot is created, the request solr/replication?command=snapshoot
      a NPE is thrown

       
      
      <?xml version="1.0" encoding="UTF-8"?> 
      <response> 
      <lst name="responseHeader">
      <int name="status">0</int>
      <int name="QTime">8</int>
      </lst>
      <str name="exception">java.lang.NullPointerException:java.lang.NullPointerException</str> 
      </response> 
      

      mail thread: http://markmail.org/thread/kthwzs7kgd3ino5t

      1. SOLR-1141.patch
        9 kB
        Shalin Shekhar Mangar
      2. SOLR-1141.patch
        3 kB
        Shalin Shekhar Mangar
      3. SOLR-1141.patch
        0.8 kB
        Shalin Shekhar Mangar

        Activity

        Hide
        Shalin Shekhar Mangar added a comment -

        The NPE is due to IndexDeletionPolicyWrapper.getLatestCommit returning null.

        A null check is added in this patch.

        Show
        Shalin Shekhar Mangar added a comment - The NPE is due to IndexDeletionPolicyWrapper.getLatestCommit returning null. A null check is added in this patch.
        Hide
        Shalin Shekhar Mangar added a comment -

        Changes:

        1. SnapShooter uses SimpleFSLockFactory instead of custom code for locking
        2. If the snapshot directory failed to create, log an error instead of silently failing with IOException
        3. Log all IOExceptions instead of silently failing
        Show
        Shalin Shekhar Mangar added a comment - Changes: SnapShooter uses SimpleFSLockFactory instead of custom code for locking If the snapshot directory failed to create, log an error instead of silently failing with IOException Log all IOExceptions instead of silently failing
        Hide
        Shalin Shekhar Mangar added a comment -

        Changes

        1. Replaced usage of ReplicationHandler.closeNoExp with IOUtils.closeQuietly
        2. Added statistics for Snapshooter – displays start time, end time and number of file in last snapshot
        Show
        Shalin Shekhar Mangar added a comment - Changes Replaced usage of ReplicationHandler.closeNoExp with IOUtils.closeQuietly Added statistics for Snapshooter – displays start time, end time and number of file in last snapshot
        Hide
        Shalin Shekhar Mangar added a comment -

        Committed revision 771378.

        I also removed the custom file copy method with FileUtils.copyFileToDirectory method.

        Show
        Shalin Shekhar Mangar added a comment - Committed revision 771378. I also removed the custom file copy method with FileUtils.copyFileToDirectory method.
        Hide
        Shalin Shekhar Mangar added a comment -

        Editing the name of the issue because it has many more changes rather than just a NPE fix.

        Show
        Shalin Shekhar Mangar added a comment - Editing the name of the issue because it has many more changes rather than just a NPE fix.
        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:
            Noble Paul
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development