ChenSammi commented on a change in pull request #2377:
URL: https://github.com/apache/ozone/pull/2377#discussion_r668516640



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/ReplicateContainerCommandHandler.java
##########
@@ -60,13 +61,20 @@ public ReplicateContainerCommandHandler(
   @Override
   public void handle(SCMCommand command, OzoneContainer container,
       StateContext context, SCMConnectionManager connectionManager) {
-
     final ReplicateContainerCommand replicateCommand =
         (ReplicateContainerCommand) command;
     final List<DatanodeDetails> sourceDatanodes =
         replicateCommand.getSourceDatanodes();
     final long containerID = replicateCommand.getContainerID();
 
+    DatanodeDetails dn = context.getParent().getDatanodeDetails();
+    if (dn.getPersistedOpState() !=
+        HddsProtos.NodeOperationalState.IN_SERVICE) {
+      LOG.info("Dn is of {} state. Ignore this replicate container command " +
+          "for container {}", dn.getPersistedOpState(), containerID);
+      return;
+    }
+

Review comment:
       Good point.




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