From f19f1d9e99c8058f6ef5caa42c1b07a8ae1de53f Mon Sep 17 00:00:00 2001 From: Ramkrishna Date: Thu, 16 Jun 2016 10:06:40 +0530 Subject: [PATCH] HBASE-15999 NPE in MemstoreCompactor (Ram) --- .../hadoop/hbase/regionserver/CompactingMemStore.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 d47ac3600ec..ec5684dcda1 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 @@ -253,10 +253,11 @@ public class CompactingMemStore extends AbstractMemStore { * in exclusive mode while this method (checkActiveSize) is invoked holding updatesLock * in the shared mode. */ InMemoryFlushRunnable runnable = new InMemoryFlushRunnable(); - LOG.info("Dispatching the MemStore in-memory flush for store " + store.getColumnFamilyName()); + if (LOG.isTraceEnabled()) { + LOG.trace( + "Dispatching the MemStore in-memory flush for store " + store.getColumnFamilyName()); + } getPool().execute(runnable); - // guard against queuing same old compactions over and over again - inMemoryFlushInProgress.set(true); } } @@ -277,10 +278,9 @@ public class CompactingMemStore extends AbstractMemStore { } // Phase II: Compact the pipeline try { - if (allowCompaction.get()) { + if (allowCompaction.get() && inMemoryFlushInProgress.compareAndSet(false, true)) { // setting the inMemoryFlushInProgress flag again for the case this method is invoked // directly (only in tests) in the common path setting from true to true is idempotent - inMemoryFlushInProgress.set(true); // Speculative compaction execution, may be interrupted if flush is forced while // compaction is in progress compactor.startCompaction();