Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-4291

FileStore.flush prone to races leading to corruption

    XMLWordPrintableJSON

Details

    Description

      There is a small window in FileStore.flush that could lead to data corruption: if we crash right after setting the persisted head but before any delay-flushed SegmentBufferWriter instance flushes (see SegmentBufferWriterPool.returnWriter()) then that data is lost although it might already be referenced from the persisted head.

      We need to come up with a test case for this.

      A possible fix would be to return a future from SegmentWriter.flush and rely on a completion callback. Such a change would most likely also be useful for OAK-3690.

      Attachments

        1. OAK_4291.patch
          8 kB
          Michael Dürig
        2. OAK_4291-UTs.patch
          8 kB
          Michael Dürig
        3. OAK-4291-02.patch
          15 kB
          Francesco Mari

        Issue Links

          Activity

            People

              mduerig Michael Dürig
              mduerig Michael Dürig
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: