commit | 01fa867940ce83945d120da9984c0cf63475c3ab | [log] [tgz] |
---|---|---|
author | Murtadha Hubail <mhubail@uci.edu> | Fri May 20 23:05:21 2016 -0700 |
committer | Murtadha Hubail <hubailmor@gmail.com> | Sat May 21 06:32:33 2016 -0700 |
tree | 799d2d24a2f3767780a0017a278d4a781c341052 | |
parent | 2348ca1278ce7bda45b0a6fee18ba8208702936f [diff] |
Fix log file EOF during recovery Change-Id: If9adbdaea726dd21d15fc1287362375daf30bf16 Reviewed-on: https://asterix-gerrit.ics.uci.edu/878 Reviewed-by: abdullah alamoudi <bamousaa@gmail.com> Reviewed-by: Michael Blow <michael.blow@couchbase.com> Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogManager.java b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogManager.java index be0435a..d5ad038 100644 --- a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogManager.java +++ b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogManager.java
@@ -205,16 +205,13 @@ protected void prepareNextLogFile() { //wait until all log records have been flushed in the current file synchronized (flushLSN) { - while (flushLSN.get() != appendLSN.get()) { - //notification will come from LogBuffer.internalFlush(.) - try { + try { + while (flushLSN.get() != appendLSN.get()) { + //notification will come from LogBuffer.internalFlush(.) flushLSN.wait(); - } catch (InterruptedException e) { - if (LOGGER.isLoggable(Level.SEVERE)) { - LOGGER.severe("Preparing new log file was interrupted"); - } - Thread.currentThread().interrupt(); } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); } } //move appendLSN and flushLSN to the first LSN of the next log file
diff --git a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java index 1592aba..148aa7e 100644 --- a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java +++ b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java
@@ -142,7 +142,7 @@ private ReturnState waitForFlushOrReturnIfEOF() { synchronized (flushLSN) { - while (readLSN > flushLSN.get()) { + while (readLSN >= flushLSN.get()) { if (isRecoveryMode) { return ReturnState.EOF; } @@ -223,7 +223,7 @@ readLSN = LSN; //wait for the log to be flushed if needed before trying to read it. synchronized (flushLSN) { - while (readLSN > flushLSN.get()) { + while (readLSN >= flushLSN.get()) { try { flushLSN.wait(); } catch (InterruptedException e) {