HDDS-1004. SCMContainerManager#updateContainerStateInternal fails for QUASI_CLOSE and FORCE_CLOSE events. Contributed by Lokesh Jain.
This commit is contained in:
parent
085f0e8ae7
commit
5d578d0c4a
@ -127,8 +127,8 @@ public void onMessage(final ContainerReportFromDatanode reportFromDatanode,
|
||||
}
|
||||
});
|
||||
} catch (ContainerNotFoundException e) {
|
||||
LOG.warn("Cannot remove container replica, container {} not found",
|
||||
id);
|
||||
LOG.warn("Cannot remove container replica, container {} not found {}",
|
||||
id, e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,8 +140,8 @@ public void onMessage(final ContainerReportFromDatanode reportFromDatanode,
|
||||
missingReplicas.forEach(id -> checkReplicationState(id, publisher));
|
||||
|
||||
} catch (NodeNotFoundException ex) {
|
||||
LOG.error("Received container report from unknown datanode {}",
|
||||
datanodeDetails);
|
||||
LOG.error("Received container report from unknown datanode {} {}",
|
||||
datanodeDetails, ex);
|
||||
}
|
||||
|
||||
}
|
||||
@ -170,12 +170,13 @@ private void processContainerReplicas(final DatanodeDetails datanodeDetails,
|
||||
containerInfo.getContainerID());
|
||||
}
|
||||
} catch (ContainerNotFoundException e) {
|
||||
LOG.error("Received container report for an unknown container {} from" +
|
||||
" datanode {}", replicaProto.getContainerID(), datanodeDetails);
|
||||
LOG.error("Received container report for an unknown container {} from"
|
||||
+ " datanode {} {}", replicaProto.getContainerID(),
|
||||
datanodeDetails, e);
|
||||
} catch (IOException e) {
|
||||
LOG.error("Exception while processing container report for container" +
|
||||
" {} from datanode {}",
|
||||
replicaProto.getContainerID(), datanodeDetails);
|
||||
LOG.error("Exception while processing container report for container"
|
||||
+ " {} from datanode {} {}", replicaProto.getContainerID(),
|
||||
datanodeDetails, e);
|
||||
}
|
||||
}
|
||||
if (pendingDeleteStatusList.getNumPendingDeletes() > 0) {
|
||||
@ -190,10 +191,8 @@ private void checkReplicationState(ContainerID containerID,
|
||||
ContainerInfo container = containerManager.getContainer(containerID);
|
||||
replicateIfNeeded(container, publisher);
|
||||
} catch (ContainerNotFoundException ex) {
|
||||
LOG.warn(
|
||||
"Container is missing from containerStateManager. Can't request "
|
||||
+ "replication. {}",
|
||||
containerID);
|
||||
LOG.warn("Container is missing from containerStateManager. Can't request "
|
||||
+ "replication. {} {}", containerID, ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -313,27 +313,6 @@ public HddsProtos.LifeCycleState updateContainerState(
|
||||
|
||||
private ContainerInfo updateContainerStateInternal(ContainerID containerID,
|
||||
HddsProtos.LifeCycleEvent event) throws IOException {
|
||||
// Refactor the below code for better clarity.
|
||||
switch (event) {
|
||||
case FINALIZE:
|
||||
// TODO: we don't need a lease manager here for closing as the
|
||||
// container report will include the container state after HDFS-13008
|
||||
// If a client failed to update the container close state, DN container
|
||||
// report from 3 DNs will be used to close the container eventually.
|
||||
break;
|
||||
case CLOSE:
|
||||
break;
|
||||
case DELETE:
|
||||
break;
|
||||
case CLEANUP:
|
||||
break;
|
||||
default:
|
||||
throw new SCMException("Unsupported container LifeCycleEvent.",
|
||||
FAILED_TO_CHANGE_CONTAINER_STATE);
|
||||
}
|
||||
// If the below updateContainerState call fails, we should revert the
|
||||
// changes made in switch case.
|
||||
// Like releasing the lease in case of BEGIN_CREATE.
|
||||
return containerStateManager.updateContainerState(containerID, event);
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ public static void finalizeAndDestroyPipeline(PipelineManager pipelineManager,
|
||||
Pipeline pipeline, Configuration ozoneConf, boolean onTimeout)
|
||||
throws IOException {
|
||||
final RaftGroup group = RatisHelper.newRaftGroup(pipeline);
|
||||
LOG.debug("destroying pipeline:{} with {}", pipeline.getId(), group);
|
||||
LOG.info("destroying pipeline:{} with {}", pipeline.getId(), group);
|
||||
pipelineManager.finalizePipeline(pipeline.getId());
|
||||
if (onTimeout) {
|
||||
long pipelineDestroyTimeoutInMillis = ozoneConf
|
||||
|
Loading…
Reference in New Issue
Block a user