Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8149

NRTCachingDirectory does not need to preemptively delete segment files and generate exceptions

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.3
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Moving over here from SOLR-11892. After getting through my confusion I've found the following: NRTCachingDirectory.createOutput tries to delete segment files before creating them. We should at least add a bit of commentary as to what the pre-emptive delete is there for since on the surface it's not obvious.

      try {
      in.deleteFile(name);
      {{ } catch (IOException ioe) {}}
      // This is fine: file may not exist
      {{ }}}

      If I change to using MMapDirectory or NIOFSDirectory these exceptions are not thrown. What's special about NRTCachingDirectory that it needs this when two of the possible underlying FS implementations apparently do not? Or is this necessary for, say, Windows or file systems than the two I tried? Or is it some interaction between the RAM based segments and segments on disk?

        Attachments

        1. LUCENE-8149.patch
          0.9 kB
          Erick Erickson

          Issue Links

            Activity

              People

              • Assignee:
                erickerickson Erick Erickson
                Reporter:
                erickerickson Erick Erickson
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: