From 7457228bcfa7a2ec862f5395983fc4c5c3032faf Mon Sep 17 00:00:00 2001 From: Joe Gresock Date: Thu, 7 Sep 2017 14:32:43 +0000 Subject: [PATCH] NIFI-4361: Fixing early recovery shutdown due to EOF in walog partition --- .../main/java/org/wali/MinimalLockingWriteAheadLog.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nifi-commons/nifi-write-ahead-log/src/main/java/org/wali/MinimalLockingWriteAheadLog.java b/nifi-commons/nifi-write-ahead-log/src/main/java/org/wali/MinimalLockingWriteAheadLog.java index 0914a791dfd5..08531eec2b58 100644 --- a/nifi-commons/nifi-write-ahead-log/src/main/java/org/wali/MinimalLockingWriteAheadLog.java +++ b/nifi-commons/nifi-write-ahead-log/src/main/java/org/wali/MinimalLockingWriteAheadLog.java @@ -474,8 +474,15 @@ private void recoverFromEdits(final Map modifiableRecordMap, final Lo subsequentTransactionId = nextPartition.getNextRecoverableTransactionId(); } catch (final IOException e) { logger.error("{} unexpectedly found End-of-File when reading from {} for Transaction ID {}; " - + "assuming crash and ignoring this transaction", + + "attempting to get the next recoverable transaction ID", new Object[]{this, nextPartition, firstTransactionId}); + try { + subsequentTransactionId = nextPartition.getNextRecoverableTransactionId(); + } catch (final IOException e2) { + logger.error("{} unexpectedly found End-of-File when reading from {} for Transaction ID {}; " + + "assuming crash and ignoring this transaction", + new Object[]{this, nextPartition, firstTransactionId}); + } } if (subsequentTransactionId != null) {