From 1dd29dba5cd9272d9a8781f7689ca99d73745411 Mon Sep 17 00:00:00 2001 From: Bryan Beaudreault Date: Wed, 9 Mar 2022 17:43:58 -0500 Subject: [PATCH] HBASE-26814 Default StoreHotnessProtector to off, with logs to guide when to turn it on (#4194) Signed-off-by: Andrew Purtell --- .../throttle/StoreHotnessProtector.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java index 7cb3a24dde76..4282c93032d0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java @@ -30,7 +30,6 @@ import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ClassSize; import org.apache.yetus.audience.InterfaceAudience; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,6 +62,10 @@ @InterfaceAudience.Private public class StoreHotnessProtector { private static final Logger LOG = LoggerFactory.getLogger(StoreHotnessProtector.class); + + // We want to log just once so that users are aware of this tool + private static volatile boolean loggedDisableMessage; + private volatile int parallelPutToStoreThreadLimit; private volatile int parallelPreparePutToStoreThreadLimit; @@ -70,7 +73,7 @@ public class StoreHotnessProtector { "hbase.region.store.parallel.put.limit"; public final static String PARALLEL_PREPARE_PUT_STORE_MULTIPLIER = "hbase.region.store.parallel.prepare.put.multiplier"; - private final static int DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT = 10; + private final static int DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT = 0; private volatile int parallelPutToStoreThreadLimitCheckMinColumnCount; public final static String PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT = "hbase.region.store.parallel.put.limit.min.column.count"; @@ -95,6 +98,13 @@ public void init(Configuration conf) { conf.getInt(PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT, DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_NUM); + if (!isEnable() && !loggedDisableMessage) { + loggedDisableMessage = true; + + LOG.info("StoreHotnessProtector is disabled. Set {} > 0 to enable, " + + "which may help mitigate load under heavy write pressure.", + PARALLEL_PUT_STORE_THREADS_LIMIT); + } } public void update(Configuration conf) {