ashishkumar50 commented on PR #6218:
URL: https://github.com/apache/ozone/pull/6218#issuecomment-1943263790

   > Thanks @ashishkumar50 for the patch, In what cases does the DB store key 
with trailing slash here ? How was the key inserted ? From what I see , if FS 
paths is enabled, even key creates are normalized and goes through same method 
(validateAndNormalizeKey) , see OmKeyCreateRequest so normalizing during delete 
is valid .
   
   @sadanand48 Thanks for the review.
   Assume when we create key like (Bucket is legacy with enableFileSystemPath)
   ozone sh key put vol1/bucket1/xyz//def/key1 file1
   It gets normalized and inserted into keyTable as (Parent trailing slash is 
preserved in OmKeyCreateRequest and that is correct):
   
   xyz/
   xyz/def/
   xyz/def/key1
   Now during delete
   
   xyz/def/key1 normalized as xyz/def/key1 and it is found in keyTable and 
deletion pass through
   xyz/def/ gets normalized into xyz/def and since keyTable has xyz/def/ and so 
it is not found and throws KEY_NOT_FOUND error.
   But we should preserve trailing slash here during delete.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to