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

Sadanand Shenoy commented on HDDS-4875:
---------------------------------------

Had a discussion with [~aryangupta1998] over this and I agree with the above 
comment.

Case : enableFsPaths = true

putKey (a/b/c/) -> writes a/b/c into the DB as normalisation is turned on.

getKey(a/b/c/) -> returns a value as while searching the DB the key is 
normalised first and then searched.

Internally it creates intermediate keys a/ & a/b/ to represent directories for 
FS. But we cannot get these intermediate keys when doing a getKey from the 
non-FS interfaces because while getting it normalises it and searches the 
keytable i.e getKey(a/b/) will look for key=a/b as it normalises and searches. 
a/b/ is a special type of key to represent directories in FS internally 
created, It should not be viewable by the non FS user. 

If we have to solve this , one way to solve this would be to check existence of 
a/b/ if a/b doesn't exist in the table which is what this 
[PR|https://github.com/apache/ozone/pull/5254] does and  set the isFile 
attribute of KeyInfo to false to represent this as a directory. But this change 
will contradict with the change done in HDDS-8496 and the robot test added 
there would fail . I think we can live with this problem of getting a 
KEY_NOT_FOUND when querying the internally created directory keys. Will close 
this in a few days if there are no more comments.

cc [~duongnguyen] 

> getKey() must return a key when a key with trailing slash is passed 
> --------------------------------------------------------------------
>
>                 Key: HDDS-4875
>                 URL: https://issues.apache.org/jira/browse/HDDS-4875
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: Ozone Manager
>            Reporter: Sadanand Shenoy
>            Assignee: Tejaskriya Madhan
>            Priority: Major
>              Labels: newbie
>
> lets assume -> Key created : a/b/c/key1 when enabledFsPaths=true
> bucket.getKey(a/b/c/) ,bucket.getKey(a/b/) must return a key instead of 
> returning KEY_NOT_FOUND because this key exists in KeyTable . While 
> normalising the key ,trailing slash isn't preserved currently. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to