From b554bbc65ec8e9482f3b00c87f8ecc39922e22dc Mon Sep 17 00:00:00 2001 From: tedyu Date: Sun, 19 Nov 2017 20:23:49 -0800 Subject: [PATCH] HBASE-19288 Intermittent test failure in TestHStore.testRunDoubleMemStoreCompactors --- .../apache/hadoop/hbase/regionserver/CompactingMemStore.java | 3 +++ .../org/apache/hadoop/hbase/regionserver/TestHStore.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java index d2502528f7b..f1232f84f24 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java @@ -429,6 +429,9 @@ public class CompactingMemStore extends AbstractMemStore { } } finally { inMemoryFlushInProgress.set(false); + if (LOG.isDebugEnabled()) { + LOG.debug("IN-MEMORY FLUSH: end"); + } } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java index 6ec091a5c44..39ed9dfa5b8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java @@ -1465,6 +1465,8 @@ public class TestHStore { int flushSize = 500; Configuration conf = HBaseConfiguration.create(); conf.set(HStore.MEMSTORE_CLASS_NAME, MyCompactingMemStoreWithCustomCompactor.class.getName()); + conf.setDouble(CompactingMemStore.IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY, 0.25); + MyCompactingMemStoreWithCustomCompactor.RUNNER_COUNT.set(0); conf.set(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, String.valueOf(flushSize)); // Set the lower threshold to invoke the "MERGE" policy conf.set(MemStoreCompactionStrategy.COMPACTING_MEMSTORE_THRESHOLD_KEY, String.valueOf(0)); @@ -1711,6 +1713,9 @@ public class TestHStore { boolean rval = super.shouldFlushInMemory(); if (rval) { RUNNER_COUNT.incrementAndGet(); + if (LOG.isDebugEnabled()) { + LOG.debug("runner count: " + RUNNER_COUNT.get()); + } } return rval; }