asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murtadha Hubail (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Fix log file EOF during recovery
Date Sat, 21 May 2016 13:32:34 GMT
Murtadha Hubail has submitted this change and it was merged.

Change subject: Fix log file EOF during recovery
......................................................................


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>
---
M asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogManager.java
M asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/logging/LogReader.java
2 files changed, 7 insertions(+), 10 deletions(-)

Approvals:
  abdullah alamoudi: Looks good to me, approved
  Michael Blow: Looks good to me, approved
  Jenkins: Verified



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) {

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/878
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If9adbdaea726dd21d15fc1287362375daf30bf16
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Murtadha Hubail <hubailmor@gmail.com>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <michael.blow@couchbase.com>
Gerrit-Reviewer: Murtadha Hubail <hubailmor@gmail.com>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message