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

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


The following commit(s) were added to refs/heads/master by this push:
     new 374b851389d degrade log level of pbtree memory status monitor (#11419)
374b851389d is described below

commit 374b851389d2a5a9add334b7b15183a639a10b3a
Author: Marcos_Zyk <[email protected]>
AuthorDate: Tue Oct 31 08:56:00 2023 +0800

    degrade log level of pbtree memory status monitor (#11419)
---
 .../rescon/CachedSchemaEngineStatistics.java       |  4 ++++
 .../rescon/MemSchemaEngineStatistics.java          | 25 +++++++++++++++++-----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/CachedSchemaEngineStatistics.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/CachedSchemaEngineStatistics.java
index 865e3d7e25d..352f1a21dcd 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/CachedSchemaEngineStatistics.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/CachedSchemaEngineStatistics.java
@@ -32,6 +32,10 @@ public class CachedSchemaEngineStatistics extends 
MemSchemaEngineStatistics {
   private final AtomicLong unpinnedMNodeNum = new AtomicLong(0);
   private final AtomicLong pinnedMNodeNum = new AtomicLong(0);
 
+  public CachedSchemaEngineStatistics() {
+    needLog = false;
+  }
+
   public void updatePinnedMNodeNum(long delta) {
     this.pinnedMNodeNum.addAndGet(delta);
   }
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java
index 66d67861cbb..a774159da23 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java
@@ -49,6 +49,10 @@ public class MemSchemaEngineStatistics implements 
ISchemaEngineStatistics {
 
   private final Object allowToCreateNewSeriesLock = new Object();
 
+  // In memory mode, we need log to warn users that the memory capacity has 
been reached.
+  // In pbtree mode, we only need related log for debug.
+  protected volatile boolean needLog = true;
+
   @Override
   public boolean isAllowToCreateNewSeries() {
     return allowToCreateNewSeries;
@@ -74,7 +78,11 @@ public class MemSchemaEngineStatistics implements 
ISchemaEngineStatistics {
     if (memoryUsage.get() >= memoryCapacity) {
       synchronized (allowToCreateNewSeriesLock) {
         if (allowToCreateNewSeries && memoryUsage.get() >= memoryCapacity) {
-          logger.warn("Current series memory {} is too large...", memoryUsage);
+          if (needLog) {
+            logger.warn("Current series memory {} is too large...", 
memoryUsage);
+          } else {
+            logger.debug("Current series memory {} is too large...", 
memoryUsage);
+          }
           allowToCreateNewSeries = false;
         }
       }
@@ -86,10 +94,17 @@ public class MemSchemaEngineStatistics implements 
ISchemaEngineStatistics {
     if (memoryUsage.get() < memoryCapacity) {
       synchronized (allowToCreateNewSeriesLock) {
         if (!allowToCreateNewSeries && memoryUsage.get() < memoryCapacity) {
-          logger.info(
-              "Current series memory {} come back to normal level, total 
series number is {}.",
-              memoryUsage,
-              totalSeriesNumber);
+          if (needLog) {
+            logger.info(
+                "Current series memory {} come back to normal level, total 
series number is {}.",
+                memoryUsage,
+                totalSeriesNumber);
+          } else {
+            logger.debug(
+                "Current series memory {} come back to normal level, total 
series number is {}.",
+                memoryUsage,
+                totalSeriesNumber);
+          }
           allowToCreateNewSeries = true;
         }
       }

Reply via email to