[
https://issues.apache.org/jira/browse/HDFS-11699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16359985#comment-16359985
]
Elek, Marton commented on HDFS-11699:
-------------------------------------
Hi, [~anu], thx to create this patch. High level I am happy with the aproach
but I don't understand the details of the implementation.
1. In ContainerMapping.java/processContainerReport: I don't undestand the
comments, but my impression is that the two method should be swaped:
{code}
containerStore.put(dbKey, newState.toByteArray());
if (!closed(newState)) {
LOG.info("Closing the Container: {}", newState.getContainerName());
}
{code}
With the original order (containerStore.put is after the closed(newState)), the
original state could overwrite the new changed state. Maybe I missed something,
but I also tried to add
{code}
Assert.assertEquals(LifeCycleState.CLOSING,
mapping.getContainer(info.getContainerName()).getState());
{code}
to the end of TestContainerClose.testClose and it is failed.
2. In ContainerMapping.closed:
{code}
if (containerUsedPercentage >= containerCloseThreshold) {
+ // We will call closer till get to the closed state.
+ closer.close(newState);
+ if (shouldClose(newState)) {
+ // This event moves the Container from Open to Closing State.
+ OzoneProtos.LifeCycleState state = updateContainerState(
+ ContainerInfo.fromProtobuf(newState).getContainerName(),
+ OzoneProtos.LifeCycleEvent.FINALIZE);
{code}
According to my understanding this code will send a close command even if the
container is in CLOSED state. IMHO it should be sent only if the container in
OPEN or CLOSING state.
3. It's not clear for me how the CLOSED state will be achieved, but maybe it's
a task of a different jira.
4. javadoc of ContainerMapping.shouldClose is misleading. It returns false if
the container is closed.
> Ozone:SCM: Add support for close containers in SCM
> --------------------------------------------------
>
> Key: HDFS-11699
> URL: https://issues.apache.org/jira/browse/HDFS-11699
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: ozone
> Affects Versions: HDFS-7240
> Reporter: Anu Engineer
> Assignee: Anu Engineer
> Priority: Major
> Attachments: HDFS-11699-HDFS-7240.001.patch
>
>
> Add support for closed containers in SCM. When a container is closed, SCM
> needs to make a set of decisions like which pool and which machines are
> expected to have this container. SCM also needs to issue a copyContainer
> command to the target datanodes so that these nodes can replicate data from
> the original locations.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]