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

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

commit be72370b92dbd5b48e6fe35d2a37b31b542c0349
Author: HTHou <[email protected]>
AuthorDate: Fri May 10 15:00:17 2024 +0800

    dev2
---
 .../db/storageengine/dataregion/memtable/TsFileProcessor.java      | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
index f6fc4a2e4a6..c3d766256f5 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
@@ -710,7 +710,8 @@ public class TsFileProcessor {
           }
 
           // Extending the column of aligned mem chunk
-          if (!alignedMemChunk.containsMeasurement(measurements[i])) {
+          if (!alignedMemChunk.containsMeasurement(measurements[i])
+              || 
!increasingMemTableMemInfo.get(deviceId).left.contains(measurements[i])) {
             memTableIncrement +=
                 (alignedMemChunk.alignedListSize() / 
PrimitiveArrayManager.ARRAY_SIZE + 1)
                     * AlignedTVList.valueListArrayMemCost(dataTypes[i]);
@@ -722,7 +723,9 @@ public class TsFileProcessor {
           }
         }
         // Here currentChunkPointNum >= 1
-        if ((alignedMemChunk.alignedListSize() % 
PrimitiveArrayManager.ARRAY_SIZE) == 0) {
+        if (((alignedMemChunk.alignedListSize()
+            + increasingMemTableMemInfo.get(deviceId).right)
+            % PrimitiveArrayManager.ARRAY_SIZE) == 0) {
           dataTypesInTVList.addAll(((AlignedTVList) 
alignedMemChunk.getTVList()).getTsDataTypes());
           memTableIncrement += 
AlignedTVList.alignedTvListArrayMemCost(dataTypesInTVList);
         }

Reply via email to