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

Mukul Kumar Singh commented on HDDS-2682:
-----------------------------------------

The problem with putKey which you explained can certainly happen. I completely 
agree with that and this jira is not trying to address that.

However, it is also important to notice that this something which we can 
reproduce with just filesystem API without any putKey right now. Sometime back, 
before moving to new implementations of OMFileCreateRequest and 
OMDirectoryCreateRequest, the getFileStatus(in KeyManagerImpl) would do a 
prefix lookup to identify if the directory already exists. This is something 
that is missing in OMFileCreateRequest#checkKeysUnderPath and this is where the 
bug is.

Reiterating once again, with the new implementations of OMFileCreateRequest and 
OMDirectoryCreateRequest this is possible just with Filesystem Apis. This is a 
regression from our earlier code and this needs to be fixed.

> OM File create request does not check for existing directory with the same 
> name
> -------------------------------------------------------------------------------
>
>                 Key: HDDS-2682
>                 URL: https://issues.apache.org/jira/browse/HDDS-2682
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Ozone Manager
>            Reporter: Supratim Deka
>            Assignee: Supratim Deka
>            Priority: Major
>
> Assume the following sequence of operations/requests:
> Req 1. create file -> /d1/d2/d3/d4/k1 (d3 implicitly is a sub-directory 
> inside /d1/d2)
> Req 2. create file -> /d1/d2/d3 (d3 as a file inside /d1/d2)
> When processing request 2, OMFileCreateRequest needs to check if 'd1/d2/d3' 
> is the name of an existing file or an existing directory. In which case the 
> request has to fail.
> Currently for request 2, OM will check explicitly if there is a key 
> '/d1/d2/d3' in the key table.
> Also for non-recursive create requests, OM will check if parent directory 
> /d1/d2 already exists. For this, the OM iterates the key table to check if 
> 'd1/d2' occurs as a prefix of any key in the key table - checkKeysUnderPath()
> What is missing in current behaviour?
> For OM File create, the table iterator must also determine if '/d1/d2/d3' 
> exists as a prefix for any key in the key table - not just '/d1/d2'.
> This fix is required for the correctness of OzoneFS namespace. There is a 
> potential performance impact - which is outside the scope of this jira and 
> will be addressed separately.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to