[ 
https://issues.apache.org/jira/browse/HDFS-12680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16211372#comment-16211372
 ] 

Nanda kumar commented on HDFS-12680:
------------------------------------

Thanks [~anu] & [~linyiqun] for the review. Please find my response below, also 
updated the patch (v001) based on the review comments.

bq. Not that it is going to make any difference, just want to make sure that 
this is a conscious decision.
Yeah, this was a conscious decision. If we don’t move the container to 
{{CREATING}} state during allocate block, we might give same container to 
multiple clients with create flag set. This will again bring in the issue of 
two clients trying to create same container.
bq. Is there a use case where this is needed.
This change was required because the state can change for a container but that 
should not result in different hashCode for the same container. In particular 
when we acquire a lease, LeaseManager uses the resource as key in a HashMap 
(ContainerInfo is the resource here) and while trying to release (after state 
change) if we don’t get a same hashCode we will not be able to find it. Since 
state is used in {{ContainerInfo#equals()}} we should not get any unexpected 
behavior.
bq.  should we add this to ozone-conf.xml?
done
bq. but what happens after the timeOut (OzoneProtos.LifeCycleEvent.TIMEOUT)
The container is moved to {{DELETING}} state, we have to do clean up after 
that. I will create another jira to track it.
bq. conf.setInt? 
done
bq. It would be better to define a var TIMEOUT=10000 and reuse this var in the 
test method.
done
bq. We should increase sleep time
done
bq. Can you add an additional check
Since {{LeaseNotFoundException}} is wrapped with {{IOException}}, added 
{{thrown.expect(IOException.class)}}
bq. The following lines don't executes in test.
Fixed

> Ozone: SCM: Lease support for container creation
> ------------------------------------------------
>
>                 Key: HDFS-12680
>                 URL: https://issues.apache.org/jira/browse/HDFS-12680
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone
>            Reporter: Nanda kumar
>            Assignee: Nanda kumar
>              Labels: ozoneMerge
>         Attachments: HDFS-12680-HDFS-7240.000.patch, 
> HDFS-12680-HDFS-7240.001.patch
>
>
> This brings in lease support for container creation.
> Lease should be give for a container that is moved to {{CREATING}} state when 
> {{BEGIN_CREATE}} event happens, {{LeaseException}} should be thrown if the 
> container already holds a lease. Lease must be released during 
> {{COMPLETE_CREATE}} event. If the lease times out container should be moved 
> to {{DELETING}} state, and exception should be thrown if {{COMPLETE_CREATE}} 
> event is received on that container.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to