dombizita commented on code in PR #10570:
URL: https://github.com/apache/ozone/pull/10570#discussion_r3622188356


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java:
##########
@@ -527,10 +527,15 @@ public void sendThrottledReplicationCommand(ContainerInfo 
containerInfo,
     DatanodeDetails source = selectAndOptionallyExcludeDatanode(
         1, sourceWithCmds);
 
-    ReplicateContainerCommand cmd =
-        ReplicateContainerCommand.toTarget(containerID, target);
-    cmd.setReplicaIndex(replicaIndex);
-    sendDatanodeCommand(cmd, containerInfo, source);
+    try {
+      ReplicateContainerCommand cmd = ReplicateContainerCommand.toTarget(
+          containerID, target,
+          nodeManager.getLowestApparentVersion(source, target));
+      cmd.setReplicaIndex(replicaIndex);
+      sendDatanodeCommand(cmd, containerInfo, source);
+    } catch (NodeNotFoundException e) {
+      throw new IllegalArgumentException("Datanode not found in NodeManager. 
Should not happen", e);

Review Comment:
   As the source and target DN can both cause the `NodeNotFoundException` I 
added both to the log message, please check if it makes sense



-- 
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]

Reply via email to