ASTERIXDB-1045: fix log file reading during recovery

Change-Id: Ic83ee1dd2d7ba88180c25f4ec6c7aa8d0a5a7162
Reviewed-on: https://asterix-gerrit.ics.uci.edu/465
Reviewed-by: Ian Maxon <imaxon@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java b/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java
index 9900468..e0cddee 100644
--- a/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java
+++ b/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java
@@ -87,8 +87,8 @@
             return null;
         }
         if (readBuffer.position() == readBuffer.limit()) {
-            boolean eof = refillLogReadBuffer();
-            if (eof && isRecoveryMode && readLSN < flushLSN.get()) {
+            boolean hasRemaining = refillLogReadBuffer();
+            if (!hasRemaining && isRecoveryMode && readLSN < flushLSN.get()) {
                 LOGGER.severe("Transaction log ends before expected. Log files may be missing.");
                 return null;
             }