From 32a945aa9fea52249a801a12740b887639a99834 Mon Sep 17 00:00:00 2001 From: Xiaolin Ha Date: Mon, 29 Aug 2022 11:49:02 +0800 Subject: [PATCH] HBASE-27152 Under compaction mark may leak (#4725) Signed-off-by: Duo Zhang --- .../org/apache/hadoop/hbase/regionserver/CompactSplit.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java index 8a6e806292a..2f1fefb0949 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java @@ -382,6 +382,12 @@ public class CompactSplit implements CompactionRequester, PropagatingConfigurati // pool; we will do selection there, and move to large pool if necessary. pool = shortCompactions; } + + // A simple implementation for under compaction marks. + // Since this method is always called in the synchronized methods, we do not need to use the + // boolean result to make sure that exactly the one that added here will be removed + // in the next steps. + underCompactionStores.add(getStoreNameForUnderCompaction(store)); pool.execute( new CompactionRunner(store, region, compaction, tracker, completeTracker, pool, user)); if (LOG.isDebugEnabled()) { @@ -390,7 +396,6 @@ public class CompactSplit implements CompactionRequester, PropagatingConfigurati + "store size is {}", getStoreNameForUnderCompaction(store), priority, underCompactionStores.size()); } - underCompactionStores.add(getStoreNameForUnderCompaction(store)); region.incrementCompactionsQueuedCount(); if (LOG.isDebugEnabled()) { String type = (pool == shortCompactions) ? "Small " : "Large ";