sodonnel commented on a change in pull request #2624:
URL: https://github.com/apache/ozone/pull/2624#discussion_r704222763
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/ClosePipelineCommandHandler.java
##########
@@ -68,12 +69,15 @@ public void handle(SCMCommand command, OzoneContainer
ozoneContainer,
final DatanodeDetails dn = context.getParent().getDatanodeDetails();
ClosePipelineCommand closePipelineCommand = (ClosePipelineCommand) command;
final PipelineID pipelineID = closePipelineCommand.getPipelineID();
+ final HddsProtos.PipelineID pipelineIdProto = pipelineID.getProtobuf();
try {
XceiverServerSpi server = ozoneContainer.getWriteChannel();
- server.removeGroup(pipelineID.getProtobuf());
- LOG.info("Close Pipeline {} command on datanode {}.", pipelineID,
- dn.getUuidString());
+ if (server.isExist(pipelineIdProto)) {
+ server.removeGroup(pipelineIdProto);
+ LOG.info("Close Pipeline {} command on datanode {}.", pipelineID,
+ dn.getUuidString());
+ }
Review comment:
I wonder if we should add an else branch for debugging (just in case we
need it):
```
} else {
LOG.debug("Ignoring close pipeline command for pipeline {} as it does not
exist", pipelineID);
}
```
--
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]