HDDS-551. Fix the close container status check in CloseContainerCommandHandler. Contributed by Shashikant Banerjee.
This commit is contained in:
parent
90e2e493b3
commit
2a5d4315bf
@ -74,6 +74,17 @@ public void handle(SCMCommand command, OzoneContainer container,
|
||||
CloseContainerCommandProto
|
||||
.parseFrom(command.getProtoBufMessage());
|
||||
containerID = closeContainerProto.getContainerID();
|
||||
if (container.getContainerSet().getContainer(containerID)
|
||||
.getContainerData().isClosed()) {
|
||||
LOG.debug("Container {} is already closed", containerID);
|
||||
// It might happen that the where the first attempt of closing the
|
||||
// container failed with NOT_LEADER_EXCEPTION. In such cases, SCM will
|
||||
// retry to check the container got really closed via Ratis.
|
||||
// In such cases of the retry attempt, if the container is already
|
||||
// closed via Ratis, we should just return.
|
||||
cmdExecuted = true;
|
||||
return;
|
||||
}
|
||||
HddsProtos.PipelineID pipelineID = closeContainerProto.getPipelineID();
|
||||
HddsProtos.ReplicationType replicationType =
|
||||
closeContainerProto.getReplicationType();
|
||||
|
@ -188,15 +188,6 @@ public void submitContainerRequest(
|
||||
ContainerProtos.ContainerCommandRequestProto request,
|
||||
ReplicationType replicationType,
|
||||
PipelineID pipelineID) throws IOException {
|
||||
if (containerSet.getContainer(request.getContainerID())
|
||||
.getContainerData().isClosed()) {
|
||||
LOG.debug("Container {} is already closed", request.getContainerID());
|
||||
// It might happen that the where the first attempt of closing the
|
||||
// container failed with NOT_LEADER_EXCEPTION. In such cases, SCM will
|
||||
// retry to check the container got really closed via Ratis.
|
||||
// In such cases of the retry attempt, if the container is already closed
|
||||
// via Ratis, we should just return.
|
||||
}
|
||||
LOG.info("submitting {} request over {} server for container {}",
|
||||
request.getCmdType(), replicationType, request.getContainerID());
|
||||
Preconditions.checkState(servers.containsKey(replicationType));
|
||||
|
Loading…
Reference in New Issue
Block a user