HubSpot Backport: HBASE-26814 Default StoreHotnessProtector to off, with logs to guide when to turn it on

This commit is contained in:
Bryan Beaudreault 2022-03-09 15:39:11 -05:00
parent 8a27821582
commit 374ed22789
1 changed files with 12 additions and 2 deletions

View File

@ -29,7 +29,6 @@ import org.apache.hadoop.hbase.regionserver.Store;
import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.ClassSize; import org.apache.hadoop.hbase.util.ClassSize;
import org.apache.yetus.audience.InterfaceAudience; import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -62,6 +61,10 @@ import org.slf4j.LoggerFactory;
@InterfaceAudience.Private @InterfaceAudience.Private
public class StoreHotnessProtector { public class StoreHotnessProtector {
private static final Logger LOG = LoggerFactory.getLogger(StoreHotnessProtector.class); 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 parallelPutToStoreThreadLimit;
private volatile int parallelPreparePutToStoreThreadLimit; private volatile int parallelPreparePutToStoreThreadLimit;
@ -69,7 +72,7 @@ public class StoreHotnessProtector {
"hbase.region.store.parallel.put.limit"; "hbase.region.store.parallel.put.limit";
public final static String PARALLEL_PREPARE_PUT_STORE_MULTIPLIER = public final static String PARALLEL_PREPARE_PUT_STORE_MULTIPLIER =
"hbase.region.store.parallel.prepare.put.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; private volatile int parallelPutToStoreThreadLimitCheckMinColumnCount;
public final static String PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT = public final static String PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT =
"hbase.region.store.parallel.put.limit.min.column.count"; "hbase.region.store.parallel.put.limit.min.column.count";
@ -94,6 +97,13 @@ public class StoreHotnessProtector {
conf.getInt(PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT, conf.getInt(PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT,
DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_NUM); 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) { public void update(Configuration conf) {