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

JackieTien97 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 1e723bcbacf Fixed the schema quota that counts audit DB (#17548)
1e723bcbacf is described below

commit 1e723bcbacf352c0360d27125e08f56d56b0550f
Author: Caideyipi <[email protected]>
AuthorDate: Fri Apr 24 12:38:23 2026 +0800

    Fixed the schema quota that counts audit DB (#17548)
---
 .../apache/iotdb/db/schemaengine/SchemaEngine.java | 23 +++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java
index dafcaa0d3b0..ede0ba13a85 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java
@@ -25,6 +25,7 @@ import 
org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
 import org.apache.iotdb.commons.conf.CommonDescriptor;
 import org.apache.iotdb.commons.consensus.SchemaRegionId;
 import org.apache.iotdb.commons.exception.MetadataException;
+import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
 import org.apache.iotdb.commons.schema.table.TsTable;
 import org.apache.iotdb.commons.utils.FileUtils;
 import org.apache.iotdb.commons.utils.PathUtils;
@@ -387,15 +388,20 @@ public class SchemaEngine {
         .filter(
             entry ->
                 schemaIds.contains(entry.getKey().getId())
-                    && 
SchemaRegionConsensusImpl.getInstance().isLeader(entry.getKey()))
+                    && 
SchemaRegionConsensusImpl.getInstance().isLeader(entry.getKey())
+                    && !entry
+                        .getValue()
+                        .getDatabaseFullPath()
+                        .equals(SystemConstant.AUDIT_DATABASE))
         .forEach(
             entry ->
-                timeSeriesNum.put(entry.getKey().getId(), 
getTimeSeriesNumber(entry.getValue())));
+                timeSeriesNum.put(
+                    entry.getKey().getId(), 
getTimeSeriesNumber4Quota(entry.getValue())));
     return timeSeriesNum;
   }
 
   // not including view number
-  private long getTimeSeriesNumber(ISchemaRegion schemaRegion) {
+  private long getTimeSeriesNumber4Quota(final ISchemaRegion schemaRegion) {
     return schemaRegion.getSchemaRegionStatistics().getSeriesNumber(false)
         + 
schemaRegion.getSchemaRegionStatistics().getTable2DevicesNumMap().entrySet().stream()
             .map(
@@ -459,13 +465,20 @@ public class SchemaEngine {
       
SchemaRegionConsensusImpl.getInstance().getAllConsensusGroupIds().stream()
           .filter(
               consensusGroupId ->
-                  
SchemaRegionConsensusImpl.getInstance().isLeader(consensusGroupId))
+                  
SchemaRegionConsensusImpl.getInstance().isLeader(consensusGroupId)
+                      && 
Optional.ofNullable(schemaRegionMap.get((SchemaRegionId) consensusGroupId))
+                          .map(
+                              schemaRegion ->
+                                  !schemaRegion
+                                      .getDatabaseFullPath()
+                                      .equals(SystemConstant.AUDIT_DATABASE))
+                          .orElse(false))
           .forEach(
               consensusGroupId ->
                   tmp.put(
                       consensusGroupId.getId(),
                       
Optional.ofNullable(schemaRegionMap.get(consensusGroupId))
-                          .map(this::getTimeSeriesNumber)
+                          .map(this::getTimeSeriesNumber4Quota)
                           .orElse(0L)));
     }
   }

Reply via email to