HBASE-26114 when “hbase.mob.compaction.threads.max” is set to a negative number, HMaster cannot start normally (#3541)

Signed-off-by: Anoop <anoopsamjohn@apache.org>
This commit is contained in:
liever18 2021-07-30 19:43:50 +08:00 committed by GitHub
parent f049301606
commit 6df4cb1cf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -863,7 +863,8 @@ public final class MobUtils {
public static ExecutorService createMobCompactorThreadPool(Configuration conf) {
int maxThreads = conf.getInt(MobConstants.MOB_COMPACTION_THREADS_MAX,
MobConstants.DEFAULT_MOB_COMPACTION_THREADS_MAX);
if (maxThreads == 0) {
// resets to default mob compaction thread number when the user sets this value incorrectly
if (maxThreads <= 0) {
maxThreads = 1;
}
final SynchronousQueue<Runnable> queue = new SynchronousQueue<>();