HDDS-1754. getContainerWithPipeline fails with PipelineNotFoundException. Contributed by Supratim Deka (#1081)

This commit is contained in:
supratimdeka 2019-07-12 10:31:48 +05:30 committed by Nanda kumar
parent 00dd843a1a
commit 738fab3bff
2 changed files with 9 additions and 1 deletions

View File

@ -467,4 +467,12 @@ public class ContainerInfo implements Comparator<ContainerInfo>,
return state == HddsProtos.LifeCycleState.OPEN return state == HddsProtos.LifeCycleState.OPEN
|| state == HddsProtos.LifeCycleState.CLOSING; || state == HddsProtos.LifeCycleState.CLOSING;
} }
/**
* Check if a container is in Open state, but Close has not been initiated.
* @return true if Open, false otherwise.
*/
public boolean isOpenNotClosing() {
return state == HddsProtos.LifeCycleState.OPEN;
}
} }

View File

@ -238,7 +238,7 @@ public class SCMClientProtocolServer implements
getContainer(id); getContainer(id);
final Pipeline pipeline; final Pipeline pipeline;
if (container.isOpen()) { if (container.isOpenNotClosing()) {
// Ratis pipeline // Ratis pipeline
pipeline = scm.getPipelineManager() pipeline = scm.getPipelineManager()
.getPipeline(container.getPipelineID()); .getPipeline(container.getPipelineID());