XNX02 commented on code in PR #14922:
URL: https://github.com/apache/iotdb/pull/14922#discussion_r1971975064


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/connector/protocol/IoTDBConfigRegionAirGapConnector.java:
##########
@@ -155,97 +151,119 @@ private void doTransferWrapper(
       return;
     }
     try {
-      doTransfer(socket, pipeConfigRegionWritePlanEvent);
+      doTransfer(pipeConfigRegionWritePlanEvent);
     } finally {
       pipeConfigRegionWritePlanEvent.decreaseReferenceCount(
           IoTDBConfigRegionAirGapConnector.class.getName(), false);
     }
   }
 
-  private void doTransfer(
-      final AirGapSocket socket,
-      final PipeConfigRegionWritePlanEvent pipeConfigRegionWritePlanEvent)
+  private void doTransfer(final PipeConfigRegionWritePlanEvent 
pipeConfigRegionWritePlanEvent)
       throws PipeException, IOException {
-    if (!send(
-        pipeConfigRegionWritePlanEvent.getPipeName(),
-        pipeConfigRegionWritePlanEvent.getCreationTime(),
-        socket,
-        PipeTransferConfigPlanReq.toTPipeTransferBytes(
-            pipeConfigRegionWritePlanEvent.getConfigPhysicalPlan()))) {
-      final String errorMessage =
-          String.format(
-              "Transfer config region write plan %s error. Socket: %s.",
-              
pipeConfigRegionWritePlanEvent.getConfigPhysicalPlan().getType(), socket);
-      // Send handshake because we don't know whether the receiver side 
configNode
-      // has set up a new one
-      sendHandshakeReq(socket);
-      receiverStatusHandler.handle(
-          new 
TSStatus(TSStatusCode.PIPE_RECEIVER_USER_CONFLICT_EXCEPTION.getStatusCode())
-              .setMessage(errorMessage),
-          errorMessage,
-          pipeConfigRegionWritePlanEvent.toString());
+    final List<Integer> socketIndexes =
+        shouldSendToAllClients
+            ? allAliveSocketsIndex()
+            : Collections.singletonList(nextSocketIndex());
+    for (final int socketIndex : socketIndexes) {
+      final AirGapSocket socket = sockets.get(socketIndex);
+      try {
+        if (!send(
+            pipeConfigRegionWritePlanEvent.getPipeName(),
+            pipeConfigRegionWritePlanEvent.getCreationTime(),
+            socket,
+            PipeTransferConfigPlanReq.toTPipeTransferBytes(
+                pipeConfigRegionWritePlanEvent.getConfigPhysicalPlan()))) {

Review Comment:
   Appreciate it. I've made some changes about this problem. Please take a look 
when you have time and let me know if you think it's working as expected.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to