szetszwo commented on code in PR #5666:
URL: https://github.com/apache/ozone/pull/5666#discussion_r1418285964
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientRatis.java:
##########
@@ -180,7 +180,7 @@ public Pipeline getPipeline() {
public void connect() throws Exception {
if (LOG.isDebugEnabled()) {
LOG.debug("Connecting to pipeline:{} datanode:{}", getPipeline().getId(),
- RatisHelper.toRaftPeerId(pipeline.getFirstNode()));
+ RatisHelper.toRaftPeerId(pipeline.getClosestNode()));
Review Comment:
Yes, see the `newRaftClient` methods in `RatisHelper`. We may change the
message to the following in the future. BTW, we should use
`pipeline.getClosestNode()` as the primary node.
```java
+++
b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientRatis.java
@@ -179,8 +179,10 @@ public Pipeline getPipeline() {
@Override
public void connect() throws Exception {
if (LOG.isDebugEnabled()) {
- LOG.debug("Connecting to pipeline:{} datanode:{}",
getPipeline().getId(),
- RatisHelper.toRaftPeerId(pipeline.getFirstNode()));
+ LOG.debug("Connecting to pipeline:{} leaderDatanode:{},
primaryDatanode:{}",
+ getPipeline().getId(),
+ RatisHelper.toRaftPeerId(pipeline.getLeaderNode()),
+ RatisHelper.toRaftPeerId(pipeline.getClosestNode()));
}
if (!client.compareAndSet(null,
diff --git
a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/ratis/RatisHelper.java
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/ratis/RatisHelper.java
index d0c9be2b42..f8c6b2ad24 100644
---
a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/ratis/RatisHelper.java
+++
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/ratis/RatisHelper.java
@@ -208,7 +208,7 @@ public static RaftClient newRaftClient(RpcType rpcType,
Pipeline pipeline,
ConfigurationSource ozoneConfiguration) throws IOException {
return newRaftClient(rpcType,
toRaftPeerId(pipeline.getLeaderNode()),
- toRaftPeer(pipeline.getFirstNode()),
+ toRaftPeer(pipeline.getClosestNode()),
newRaftGroup(RaftGroupId.valueOf(pipeline.getId().getId()),
pipeline.getNodes()), retryPolicy, tlsConfig,
ozoneConfiguration);
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]