Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5331

SequentialAccessWriteAheadLog: poisioned journal requires restart

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.8.0
    • Core Framework
    • None

    Description

      If using the SequentialAccessWriteAheadLog, once a journal becomes poisoned, NiFi can't recover without a restart.  

      SequentialAccessWriteAheadLog uses a LengthDelimitedJournal which has a "poisoned" flag[1].  This is initially set "false", but is set true if an Exceptions or Throwable is encountered on a write operation[2].  Once poisoned, calls to update()[3] will result in a call to checkState()[4] which then throws an IOException stating, "Cannot update journal file... If the repository is able to checkpoint, then this problem will resolve itself..."  SequentialAccessWriteAheadLog.checkpoint()[5] creates a new LengthDelimitedJournal which would hypothetically have a cleared "poisoned" flag .  However, before creating that new Journal, it calls journal.fsync()[6], which calls checkState(), which throws the above IOException if poisoned == true.  So, the FlowFileRepository enters a state where it cannot be written to, and cannot recover, until the instance is restarted.

       

      [1] https://github.com/apache/nifi/blob/rel/nifi-1.6.0/nifi-commons/nifi-write-ahead-log/src/main/java/org/apache/nifi/wali/LengthDelimitedJournal.java#L70 

      [2] https://github.com/apache/nifi/blob/rel/nifi-1.6.0/nifi-commons/nifi-write-ahead-log/src/main/java/org/apache/nifi/wali/LengthDelimitedJournal.java#L208 

      [3] https://github.com/apache/nifi/blob/rel/nifi-1.6.0/nifi-commons/nifi-write-ahead-log/src/main/java/org/apache/nifi/wali/LengthDelimitedJournal.java#L178

      [4] https://github.com/apache/nifi/blob/rel/nifi-1.6.0/nifi-commons/nifi-write-ahead-log/src/main/java/org/apache/nifi/wali/LengthDelimitedJournal.java#L217 

      [5] https://github.com/apache/nifi/blob/rel/nifi-1.6.0/nifi-commons/nifi-write-ahead-log/src/main/java/org/apache/nifi/wali/SequentialAccessWriteAheadLog.java#L279 

      [6] https://github.com/apache/nifi/blob/rel/nifi-1.6.0/nifi-commons/nifi-write-ahead-log/src/main/java/org/apache/nifi/wali/SequentialAccessWriteAheadLog.java#L259 

      Attachments

        Issue Links

          Activity

            People

              markap14 Mark Payne
              devriesb Brandon Rhys DeVries
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: