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

Filesystems do not guarantee order of directories updates

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.2
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Currently when index is written to disk the following sequence of events is taking place:

      • write segment file
      • sync segment file
      • write segment file
      • sync segment file
        ...
      • write list of segments
      • sync list of segments
      • rename list of segments
      • sync index directory

      This sequence leads to potential window of opportunity for system to crash after 'rename list of segments' but before 'sync index directory' and depending on exact filesystem implementation this may potentially lead to 'list of segments' being visible in directory while some of the segments are not.

      Solution to this is to sync index directory after all segments have been written. This commit shows idea implemented. I'm fairly certain that I didn't find all the places this may be potentially happening.

        Attachments

        1. LUCENE-8048.patch
          6 kB
          Erick Erickson
        2. LUCENE-8048.patch
          5 kB
          Simon Willnauer
        3. Screen Shot 2017-11-22 at 12.34.51 PM.png
          86 kB
          Erick Erickson
        4. LUCENE-8048.patch
          0.6 kB
          Erick Erickson

          Activity

            People

            • Assignee:
              erickerickson Erick Erickson
              Reporter:
              mar-kolya Nikolay Martynov
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: