You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2021/11/09 02:35:03 UTC

[hbase] branch master updated: HBASE-26430 Increase log level in DefaultHeapMemoryTuner from DEBUG to INFO (#3820)

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

apurtell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 407a5bd  HBASE-26430 Increase log level in DefaultHeapMemoryTuner from DEBUG to INFO (#3820)
407a5bd is described below

commit 407a5bd81253ccdffc7d41244b56201a09996ef6
Author: Andrew Purtell <ap...@apache.org>
AuthorDate: Mon Nov 8 18:34:14 2021 -0800

    HBASE-26430 Increase log level in DefaultHeapMemoryTuner from DEBUG to INFO (#3820)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    Signed-off-by: Viraj Jasani <vj...@apache.org>
---
 .../hbase/regionserver/DefaultHeapMemoryTuner.java     | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultHeapMemoryTuner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultHeapMemoryTuner.java
index 2ff7d58..9b8b3ef 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultHeapMemoryTuner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultHeapMemoryTuner.java
@@ -135,6 +135,8 @@ class DefaultHeapMemoryTuner implements HeapMemoryTuner {
       // Ignoring the first few tuner periods
       ignoreInitialPeriods++;
       rollingStatsForTunerSteps.insertDataValue(0);
+      LOG.info("Ignoring initial tuning periods: {} so far, {} to ignore", ignoreInitialPeriods,
+        numPeriodsToIgnore);
       return NO_OP_TUNER_RESULT;
     }
     StepDirection newTuneDirection = getTuneDirection(context);
@@ -252,12 +254,15 @@ class DefaultHeapMemoryTuner implements HeapMemoryTuner {
     if (earlyMemstoreSufficientCheck && earlyBlockCacheSufficientCheck) {
       // Both memstore and block cache memory seems to be sufficient. No operation required.
       newTuneDirection = StepDirection.NEUTRAL;
+      tunerLog.append("Going to do nothing because no changes are needed.");
     } else if (earlyMemstoreSufficientCheck) {
       // Increase the block cache size and corresponding decrease in memstore size.
       newTuneDirection = StepDirection.INCREASE_BLOCK_CACHE_SIZE;
+      tunerLog.append("Going to increase the block cache size.");
     } else if (earlyBlockCacheSufficientCheck) {
       // Increase the memstore size and corresponding decrease in block cache size.
       newTuneDirection = StepDirection.INCREASE_MEMSTORE_SIZE;
+      tunerLog.append("Going to increase the memstore size.");
     } else {
       // Early checks for sufficient memory failed. Tuning memory based on past statistics.
       // Boolean indicator to show if we need to revert previous step or not.
@@ -347,8 +352,17 @@ class DefaultHeapMemoryTuner implements HeapMemoryTuner {
         }
       }
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug(tunerLog.toString());
+    // Log NEUTRAL decisions at DEBUG, because they are the most frequent and not that interesting.
+    // Log other decisions at INFO because they are making meaningful operational changes.
+    switch (newTuneDirection) {
+      case NEUTRAL:
+        if (LOG.isDebugEnabled()) {
+          LOG.debug(tunerLog.toString());
+        }
+        break;
+      default:
+        LOG.info(tunerLog.toString());
+        break;
     }
     return newTuneDirection;
   }