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

Aryan Gupta commented on HDDS-9610:
-----------------------------------

[~xbis], We analyzed this case and we found out there are some corner cases 
that would still exist if we change the successful deletion message like, 
Lets say we delete dir1 that contains file1 , file2
In Legacy, it will list and create 3 keys to delete = \{dir1, dir1/file1, 
dir1/file2}, next time we again try to delete dir1 but as a first step, we do 
getFileStatus(dir1) which will return KEY_NOT_FOUND and delete will abort 
keeping 2 orphan keys in KeyTable and the client wouldn't able to delete those 
keys and they will be present in key table forever as mentioned in the above 
comment. We have to fix a lot of such issues to address all the corner cases so 
we recommend using the FSO bucket to overcome these issues!
cc [~sumitagrawl] [~ashishk] [~sadanand_shenoy] 

> Recursive fs delete on a Legacy bucket succeeds even if no keys were deleted
> ----------------------------------------------------------------------------
>
>                 Key: HDDS-9610
>                 URL: https://issues.apache.org/jira/browse/HDDS-9610
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: OFS, Ozone CLI
>            Reporter: Christos Bisias
>            Assignee: Aryan Gupta
>            Priority: Major
>              Labels: pull-request-available
>
> For a Legacy bucket, recursive delete might appear successful even if no keys 
> were actually deleted.
> The issue can be reproduced in the docker dev env. Edit *docker-config* to 
> enable native ACLs
> {noformat}
> OZONE-SITE.XML_ozone.acl.enabled=true 
> OZONE-SITE.XML_ozone.acl.authorizer.class=org.apache.hadoop.ozone.security.acl.OzoneNativeAuthorizer{noformat}
> Start the docker env and run the commands below
> {code:java}
> > docker-compose exec -T om ozone sh volume create /vol1
> > docker-compose exec -T om ozone sh bucket create /vol1/bucket1 -l LEGACY
> > docker-compose exec -T om ozone sh volume setacl -a 
> > user:testuser2:rw,user:testuser:a,group:testuser2:rw,group:testuser:a vol1
> ACLs set successfully.
> > docker-compose exec -T om ozone sh bucket setacl -a 
> > user:testuser2:rwlc,user:testuser:a,group:testuser2:rwlc,group:testuser:a 
> > vol1/bucket1
> ACLs set successfully.
> > docker-compose exec -T -u testuser om ozone fs -mkdir /vol1/bucket1/dir1
> > docker-compose exec -T -u testuser om ozone fs -put ./README.md 
> > /vol1/bucket1/dir1/readme
> > docker-compose exec -T -u testuser2 om ozone fs -rm -r -skipTrash 
> > /vol1/bucket1/dir1
> Deleted /vol1/bucket1/dir1
> > docker-compose exec -T -u testuser om ozone fs -ls /vol1/bucket1/dir1
> Found 1 items
> -rw-rw-rw-   3 testuser testuser       4068 2023-11-02 16:53 
> /vol1/bucket1/dir1/readme {code}
> This is happening because in 
> *BasicRootedOzoneFileSystem* we are processing keys one by one and if there 
> is a recursive flag, we ignore whether the key was deleted or not, just to 
> continue with processing the next iteration. The result should be a success 
> only if all keys were successfully deleted.



--
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