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

rong 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 f39c7be3c0c Pipe: fixed the bug that released 
PipeRawTabletInsertionEvent's tablet is still referenced and causing OOM 
(#12117)
f39c7be3c0c is described below

commit f39c7be3c0c2e40b103aed81a32dda9208b998bc
Author: Caideyipi <[email protected]>
AuthorDate: Fri Mar 8 10:59:52 2024 +0800

    Pipe: fixed the bug that released PipeRawTabletInsertionEvent's tablet is 
still referenced and causing OOM (#12117)
---
 .../event/common/tablet/PipeInsertNodeTabletInsertionEvent.java   | 2 ++
 .../db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java  | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java
index c2e0f07abd3..4540e8553a2 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeInsertNodeTabletInsertionEvent.java
@@ -127,6 +127,8 @@ public class PipeInsertNodeTabletInsertionEvent extends 
EnrichedEvent
   public boolean internallyDecreaseResourceReferenceCount(String 
holderMessage) {
     try {
       PipeResourceManager.wal().unpin(walEntryHandler);
+      // Release the container's memory.
+      dataContainer = null;
       return true;
     } catch (Exception e) {
       LOGGER.warn(
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
index 5593265c40a..c841d964331 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
@@ -36,10 +36,10 @@ import java.util.function.BiConsumer;
 
 public class PipeRawTabletInsertionEvent extends EnrichedEvent implements 
TabletInsertionEvent {
 
-  private final Tablet tablet;
+  private Tablet tablet;
   private final boolean isAligned;
 
-  private final EnrichedEvent sourceEvent;
+  private EnrichedEvent sourceEvent;
   private boolean needToReport;
 
   private PipeTabletMemoryBlock allocatedMemoryBlock;
@@ -106,6 +106,10 @@ public class PipeRawTabletInsertionEvent extends 
EnrichedEvent implements Tablet
   @Override
   public boolean internallyDecreaseResourceReferenceCount(String 
holderMessage) {
     allocatedMemoryBlock.close();
+    // Actually release the occupied memory.
+    tablet = null;
+    sourceEvent = null;
+    dataContainer = null;
     return true;
   }
 

Reply via email to