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

jt2594838 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 b4c4e5483f4 Fix stale deletion resource manager reuse (#18057)
b4c4e5483f4 is described below

commit b4c4e5483f4db7d26aaa4ea57b0f7da46fd4560b
Author: Caideyipi <[email protected]>
AuthorDate: Tue Jun 30 11:18:03 2026 +0800

    Fix stale deletion resource manager reuse (#18057)
---
 .../db/pipe/consensus/deletion/DeletionResourceManager.java    |  3 +++
 .../apache/iotdb/db/pipe/consensus/DeletionResourceTest.java   | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/DeletionResourceManager.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/DeletionResourceManager.java
index d2292dae0ad..956b7e1664b 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/DeletionResourceManager.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/DeletionResourceManager.java
@@ -132,6 +132,9 @@ public class DeletionResourceManager implements 
AutoCloseable {
     LOGGER.info(DataNodePipeMessages.CLOSING_DELETION_RESOURCE_MANAGER_FOR, 
dataRegionId);
     this.deleteNode2ResourcesMap.clear();
     this.deletionBuffer.close();
+    if (DeletionResourceManagerHolder.CONSENSUS_GROUP_ID_2_INSTANCE_MAP != 
null) {
+      
DeletionResourceManagerHolder.CONSENSUS_GROUP_ID_2_INSTANCE_MAP.remove(dataRegionId,
 this);
+    }
     LOGGER.info(
         
DataNodePipeMessages.DELETION_RESOURCE_MANAGER_FOR_HAS_BEEN_SUCCESSFULLY, 
dataRegionId);
   }
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/consensus/DeletionResourceTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/consensus/DeletionResourceTest.java
index 8eb43cab077..c64174720e1 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/consensus/DeletionResourceTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/consensus/DeletionResourceTest.java
@@ -102,6 +102,16 @@ public class DeletionResourceTest {
     Assert.assertTrue(dataRegionDir.exists());
   }
 
+  @Test
+  public void testGetInstanceAfterCloseReturnsFreshManager() {
+    DeletionResourceManager closedDeletionResourceManager =
+        DeletionResourceManager.getInstance(FAKE_DATA_REGION_IDS[0]);
+    closedDeletionResourceManager.close();
+
+    deletionResourceManager = 
DeletionResourceManager.getInstance(FAKE_DATA_REGION_IDS[0]);
+    Assert.assertNotSame(closedDeletionResourceManager, 
deletionResourceManager);
+  }
+
   @Test
   public void testAddBatchDeletionResource()
       throws IllegalPathException, IOException, InterruptedException {

Reply via email to