asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhub...@apache.org
Subject incubator-asterixdb git commit: Fix log file EOF during recovery
Date Sat, 21 May 2016 13:32:39 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master 2348ca127 -> 01fa86794


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>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/01fa8679
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/01fa8679
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/01fa8679

Branch: refs/heads/master
Commit: 01fa867940ce83945d120da9984c0cf63475c3ab
Parents: 2348ca1
Author: Murtadha Hubail <mhubail@uci.edu>
Authored: Fri May 20 23:05:21 2016 -0700
Committer: Murtadha Hubail <hubailmor@gmail.com>
Committed: Sat May 21 06:32:33 2016 -0700

----------------------------------------------------------------------
 .../management/service/logging/LogManager.java         | 13 +++++--------
 .../management/service/logging/LogReader.java          |  4 ++--
 2 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/01fa8679/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogManager.java
----------------------------------------------------------------------
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 @@ public class LogManager implements ILogManager, ILifeCycleComponent
{
     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

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/01fa8679/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java
----------------------------------------------------------------------
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 @@ public class LogReader implements ILogReader {
 
     private ReturnState waitForFlushOrReturnIfEOF() {
         synchronized (flushLSN) {
-            while (readLSN > flushLSN.get()) {
+            while (readLSN >= flushLSN.get()) {
                 if (isRecoveryMode) {
                     return ReturnState.EOF;
                 }
@@ -223,7 +223,7 @@ public class LogReader implements ILogReader {
         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) {


Mime
View raw message