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

FSDirectory's fsync() is lenient

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.7.2, 4.8, 6.0
    • core/store
    • None
    • New

    Description

      This method has a lot of problems:
      1. it tracks 'stale files' as it writes (this seems pointless), and only actually fsyncs the intersection of that 'stale files' and the filenames passed as argument to sync(). So any bogus names passed to sync() are just silently ignored
      2. if "something bad happens" (e.g. two indexwriters/dirs on the same path, or some other shenanigans), and the file is actually in stale files, but was say actually deleted on the filesystem, the underlying fsync() call will create a new 0-byte file and fsync that.

      In my opinion we should do none of this. we should throw exceptions when this stuff is wrong.

      Attachments

        1. LUCENE-5570_java6.patch
          4 kB
          Robert Muir
        2. LUCENE-5570.patch
          3 kB
          Robert Muir
        3. LUCENE-5570_zerobyte.patch
          2 kB
          Robert Muir
        4. LUCENE-5570.patch
          4 kB
          Robert Muir

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rcmuir Robert Muir
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: