You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2025/08/31 14:27:39 UTC

(hbase) branch branch-2 updated: HBASE-28866 Setting `hbase.oldwals.cleaner.thread.size` to negative value will break HMaster and produce hard-to-diagnose logs (#6310)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new a895be41fd3 HBASE-28866 Setting `hbase.oldwals.cleaner.thread.size` to negative value will break HMaster and produce hard-to-diagnose logs (#6310)
a895be41fd3 is described below

commit a895be41fd37366d7220c44e5cd9d574b50d5d1f
Author: Ariadne-team <36...@qq.com>
AuthorDate: Sun Aug 31 22:23:55 2025 +0800

    HBASE-28866 Setting `hbase.oldwals.cleaner.thread.size` to negative value will break HMaster and produce hard-to-diagnose logs (#6310)
    
    Co-authored-by: AlphaDora <59...@qq.com>
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit 8a7defb858a618dbc18ebe528b4b12fa17cc6f72)
---
 .../java/org/apache/hadoop/hbase/master/cleaner/LogCleaner.java    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/LogCleaner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/LogCleaner.java
index ac0a98801c1..6ede2b50d8a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/LogCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/LogCleaner.java
@@ -78,6 +78,13 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
       pool, params, null);
     this.pendingDelete = new LinkedBlockingQueue<>();
     int size = conf.getInt(OLD_WALS_CLEANER_THREAD_SIZE, DEFAULT_OLD_WALS_CLEANER_THREAD_SIZE);
+    if (size <= 0) {
+      size = DEFAULT_OLD_WALS_CLEANER_THREAD_SIZE;
+      LOG.warn(
+        "The configuration {} has been set to an invalid value {}, "
+          + "the default value {} will be used.",
+        OLD_WALS_CLEANER_THREAD_SIZE, size, DEFAULT_OLD_WALS_CLEANER_THREAD_SIZE);
+    }
     this.oldWALsCleaner = createOldWalsCleaner(size);
     this.cleanerThreadTimeoutMsec = conf.getLong(OLD_WALS_CLEANER_THREAD_TIMEOUT_MSEC,
       DEFAULT_OLD_WALS_CLEANER_THREAD_TIMEOUT_MSEC);