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

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

commit cc8a718932170116952d7d477f48f4746df17946
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)
    
    (cherry picked from commit 685141a6405e79533906c6bf2700707296828777)
---
 .../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