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

jackietien 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 685141a6405 Fixed the bug that the attribute update container may add 
extra calculated memory to schema engine (#16682)
685141a6405 is described below

commit 685141a6405e79533906c6bf2700707296828777
Author: Caideyipi <[email protected]>
AuthorDate: Fri Oct 31 17:23:47 2025 +0800

    Fixed the bug that the attribute update container may add extra calculated 
memory to schema engine (#16682)
---
 .../attribute/update/DeviceAttributeCacheUpdater.java             | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/attribute/update/DeviceAttributeCacheUpdater.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/attribute/update/DeviceAttributeCacheUpdater.java
index 64d92335b1b..fd798cc3a7d 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/attribute/update/DeviceAttributeCacheUpdater.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/attribute/update/DeviceAttributeCacheUpdater.java
@@ -440,17 +440,23 @@ public class DeviceAttributeCacheUpdater {
     if (size > 0) {
       requestMemory(size);
     } else {
-      releaseMemory(size);
+      releaseMemory(-size);
     }
   }
 
   private void requestMemory(final long size) {
+    if (size < 0) {
+      throw new UnsupportedOperationException("requestMemory size must not be 
negative");
+    }
     if (regionStatistics != null) {
       regionStatistics.requestMemory(size);
     }
   }
 
   private void releaseMemory(final long size) {
+    if (size < 0) {
+      throw new UnsupportedOperationException("releaseMemory size must not be 
negative");
+    }
     if (regionStatistics != null) {
       regionStatistics.releaseMemory(size);
     }

Reply via email to