SteveYurongSu commented on code in PR #11994:
URL: https://github.com/apache/iotdb/pull/11994#discussion_r1475538448
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/airgap/IoTDBAirGapConnector.java:
##########
@@ -194,11 +198,24 @@ public void handshake() throws Exception {
continue;
}
- if (!send(
- socket,
- PipeTransferHandshakeReq.toTransferHandshakeBytes(
-
CommonDescriptor.getInstance().getConfig().getTimestampPrecision()))) {
- throw new PipeException("Handshake error with target server ip: " + ip
+ ", port: " + port);
+ // Try to handshake by PipeTransferHandshakeV2Req.
+ HashMap<String, String> params = new HashMap<>();
+ params.put(
+ PipeTransferHandshakeConstant.HANDSHAKE_KEY_CLUSTER_ID,
+ PipeAgent.runtime().getClusterIdIfPossible());
+ params.put(
+ PipeTransferHandshakeConstant.HANDSHAKE_KEY_TIME_PRECISION,
+ CommonDescriptor.getInstance().getConfig().getTimestampPrecision());
+
+ if (!send(socket,
PipeTransferHandshakeV2Req.toTransferHandshakeBytes(params))) {
+ // Retry to handshake with PipeTransferHandshakeV1Req.
+ if (!send(
Review Comment:
else branch can not be ignored.
--
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]