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

tanxinyu 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 10b1220537d IoTConsensusV2: Fix Create DataRegion Failed. #14050
10b1220537d is described below

commit 10b1220537d105366f058d7158a890382a5bcb75
Author: Peng Junzhi <[email protected]>
AuthorDate: Mon Nov 11 21:37:10 2024 +0800

    IoTConsensusV2: Fix Create DataRegion Failed. #14050
---
 .../iotdb/consensus/pipe/consensuspipe/ConsensusPipeManager.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/consensuspipe/ConsensusPipeManager.java
 
b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/consensuspipe/ConsensusPipeManager.java
index ce5ed5bfb12..f4bb5ca8a35 100644
--- 
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/consensuspipe/ConsensusPipeManager.java
+++ 
b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/consensuspipe/ConsensusPipeManager.java
@@ -61,14 +61,18 @@ public class ConsensusPipeManager {
     this.selector = config.getConsensusPipeSelector();
   }
 
+  /** This method is used except region migration. */
   public void createConsensusPipe(Peer senderPeer, Peer receiverPeer) throws 
Exception {
     ConsensusPipeName consensusPipeName = new ConsensusPipeName(senderPeer, 
receiverPeer);
+    // The third parameter is only used when region migration. Since this 
method is not called by
+    // region migration, just pass senderPeer in to get the correct result.
     Triple<ImmutableMap<String, String>, ImmutableMap<String, String>, 
ImmutableMap<String, String>>
-        params = buildPipeParams(senderPeer, receiverPeer, null);
+        params = buildPipeParams(senderPeer, receiverPeer, senderPeer);
     dispatcher.createPipe(
         consensusPipeName.toString(), params.getLeft(), params.getMiddle(), 
params.getRight());
   }
 
+  /** This method is used when executing region migration */
   public void createConsensusPipe(
       Peer senderPeer, Peer receiverPeer, Peer regionMigrationCoordinatorPeer) 
throws Exception {
     ConsensusPipeName consensusPipeName = new ConsensusPipeName(senderPeer, 
receiverPeer);

Reply via email to