sodonnel commented on a change in pull request #2377:
URL: https://github.com/apache/ozone/pull/2377#discussion_r666844379
##########
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:
I think this needs to go into the supervisor, so that when the task is
executed by the executor, it checks to see the DN state and drops the command
at that point. We could have a lot of replication commands queued which are
past this point, and if the DN switches to a not IN_SERVICE state, ideally we
want to prevent processing them all.
--
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]