hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject [4/4] hbase git commit: HBASE-14843 TestWALProcedureStore.testLoad is flakey
Date Mon, 23 Nov 2015 18:55:05 GMT
HBASE-14843 TestWALProcedureStore.testLoad is flakey


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/58870c30
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/58870c30
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/58870c30

Branch: refs/heads/branch-1.1
Commit: 58870c30f151c4c79cbdf1019ab0e2c3d971941c
Parents: 74c89af
Author: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Authored: Mon Nov 23 09:54:42 2015 -0800
Committer: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Committed: Mon Nov 23 10:21:11 2015 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/procedure2/store/wal/WALProcedureStore.java  | 7 ++++++-
 .../hbase/procedure2/store/wal/TestWALProcedureStore.java     | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/58870c30/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
index 975bd33..decc83f 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
@@ -116,6 +116,7 @@ public class WALProcedureStore implements ProcedureStore {
   private final FileSystem fs;
   private final Path logDir;
 
+  private AtomicBoolean loading = new AtomicBoolean(true);
   private AtomicBoolean inSync = new AtomicBoolean(false);
   private AtomicReference<Throwable> syncException = new AtomicReference<>();
   private LinkedTransferQueue<ByteSlot> slotsCache = null;
@@ -296,6 +297,7 @@ public class WALProcedureStore implements ProcedureStore {
       if (LOG.isDebugEnabled()) {
         LOG.debug("No state logs to replay.");
       }
+      loading.set(false);
       return null;
     }
 
@@ -325,6 +327,7 @@ public class WALProcedureStore implements ProcedureStore {
           removeLogFile(log);
         }
       }
+      loading.set(false);
     }
   }
 
@@ -533,7 +536,9 @@ public class WALProcedureStore implements ProcedureStore {
         try {
           // Wait until new data is available
           if (slotIndex == 0) {
-            removeInactiveLogs();
+            if (!loading.get()) {
+              removeInactiveLogs();
+            }
 
             if (LOG.isTraceEnabled()) {
               float rollTsSec = getMillisFromLastRoll() / 1000.0f;

http://git-wip-us.apache.org/repos/asf/hbase/blob/58870c30/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
index 8ba23f9..4111dd0 100644
--- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
+++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
@@ -207,6 +207,7 @@ public class TestWALProcedureStore {
     procStore = ProcedureTestingUtility.createWalStore(conf, fs, logDir);
     procStore.start(NTHREAD);
     procStore.recoverLease();
+    assertEquals(0, countProcedures(procStore.load()));
 
     final long LAST_PROC_ID = 9999;
     final Thread[] thread = new Thread[NTHREAD];


Mime
View raw message