From 5d0b1accbe3007c8f6bffff8c654e8f2f44f1689 Mon Sep 17 00:00:00 2001 From: liever18 <1056353055@qq.com> Date: Thu, 29 Jul 2021 15:27:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?HBASE-26114=20when=20=E2=80=9Chbase.mob.com?= =?UTF-8?q?paction.threads.max=E2=80=9D=20is=20set=20to=20a=20negative=20n?= =?UTF-8?q?umber,=20HMaster=20cannot=20start=20normally?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit improve the handling mechanism for the user to set hbase.mob.compaction.threads.max as an abnormal value. --- .../src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java index c2c0d8102a49..7cc368da7b40 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java @@ -863,7 +863,7 @@ public static void doMobCompaction(Configuration conf, FileSystem fs, TableName public static ExecutorService createMobCompactorThreadPool(Configuration conf) { int maxThreads = conf.getInt(MobConstants.MOB_COMPACTION_THREADS_MAX, MobConstants.DEFAULT_MOB_COMPACTION_THREADS_MAX); - if (maxThreads == 0) { + if (maxThreads <= 0) { maxThreads = 1; } final SynchronousQueue queue = new SynchronousQueue<>(); From 89a5915b66c39c450284023d3d02249e19803a30 Mon Sep 17 00:00:00 2001 From: liever18 <1056353055@qq.com> Date: Fri, 30 Jul 2021 15:00:41 +0800 Subject: [PATCH 2/2] HBASE-26114 when hbase.mob.compaction.threads.max is set to a negative number, HMaster cannot start normally add modification instructions --- .../src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java index 7cc368da7b40..6377821aa734 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java @@ -863,6 +863,7 @@ public static void doMobCompaction(Configuration conf, FileSystem fs, TableName public static ExecutorService createMobCompactorThreadPool(Configuration conf) { int maxThreads = conf.getInt(MobConstants.MOB_COMPACTION_THREADS_MAX, MobConstants.DEFAULT_MOB_COMPACTION_THREADS_MAX); + // resets to default mob compaction thread number when the user sets this value incorrectly if (maxThreads <= 0) { maxThreads = 1; }