Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-26814 Default StoreHotnessProtector to off, with logs to guide when to turn it on #4194

Merged
merged 2 commits into from
Mar 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -63,14 +62,18 @@
@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;
public final static String PARALLEL_PUT_STORE_THREADS_LIMIT =
"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";
Expand All @@ -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) {
Expand Down