Fix a mutual waiting condition during switching the txn log file:

-- LogManager waits for LogBuffer to flush,
-- LogBuffer is not full and cannot flush.

Change-Id: I7bf7b70675ab68005e581a296ac4f4515f1d5ad4
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1333
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
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 947ebc7..814bcfc 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
@@ -203,6 +203,8 @@
     }
 
     protected void prepareNextLogFile() {
+        // Make sure to flush whatever left in the log tail.
+        appendPage.isFull(true);
         //wait until all log records have been flushed in the current file
         synchronized (flushLSN) {
             try {