You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2024/04/01 10:10:52 UTC

(iotdb) branch master updated: Pipe: Fix schema region snapshot may not be listened when DataNode restarts (#12270)

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 d859d5f0c9b Pipe: Fix schema region snapshot may not be listened when DataNode restarts (#12270)
d859d5f0c9b is described below

commit d859d5f0c9b97b472766737e04f831f72de2490b
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Mon Apr 1 18:10:45 2024 +0800

    Pipe: Fix schema region snapshot may not be listened when DataNode restarts (#12270)
---
 .../statemachine/schemaregion/SchemaRegionStateMachine.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaRegionStateMachine.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaRegionStateMachine.java
index 5d5ebff582d..f78b835d04b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaRegionStateMachine.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaRegionStateMachine.java
@@ -116,7 +116,7 @@ public class SchemaRegionStateMachine extends BaseStateMachine {
         && PipeAgent.runtime()
             .schemaListener(schemaRegion.getSchemaRegionId())
             .createSnapshot(snapshotDir)) {
-      listen2Snapshot4PipeListener();
+      listen2Snapshot4PipeListener(true);
       return true;
     }
     return false;
@@ -130,16 +130,16 @@ public class SchemaRegionStateMachine extends BaseStateMachine {
         .loadSnapshot(latestSnapshotRootDir);
     // We recompute the snapshot for pipe listener when loading snapshot
     // to recover the newest snapshot in cache
-    listen2Snapshot4PipeListener();
+    listen2Snapshot4PipeListener(false);
   }
 
-  public void listen2Snapshot4PipeListener() {
+  public void listen2Snapshot4PipeListener(boolean isTmp) {
     Pair<Path, Path> snapshotPaths =
         SchemaRegionSnapshotParser.getSnapshotPaths(
             Utils.fromConsensusGroupIdToRaftGroupId(schemaRegion.getSchemaRegionId())
                 .getUuid()
                 .toString(),
-            true);
+            isTmp);
     SchemaRegionListeningQueue listener =
         PipeAgent.runtime().schemaListener(schemaRegion.getSchemaRegionId());
     if (Objects.isNull(snapshotPaths) || Objects.isNull(snapshotPaths.getLeft())) {