HBASE-19288 Intermittent test failure in TestHStore.testRunDoubleMemStoreCompactors

This commit is contained in:
tedyu 2017-11-19 20:23:49 -08:00
parent 50c3bf9feb
commit b554bbc65e
2 changed files with 8 additions and 0 deletions

View File

@ -429,6 +429,9 @@ public class CompactingMemStore extends AbstractMemStore {
}
} finally {
inMemoryFlushInProgress.set(false);
if (LOG.isDebugEnabled()) {
LOG.debug("IN-MEMORY FLUSH: end");
}
}
}

View File

@ -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;
}