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

Christos Bisias commented on HDDS-9610:
---------------------------------------

[~ashishk] [~sadanand_shenoy] Should we also consider being consistent with FSO?

FSO goes over all the keys and if even 1 of them fails, then none of them are 
deleted.

Legacy, processes the keys one by one and as a result, if a key can be deleted, 
it will be. Keys that can't be deleted are skipped. That's a common behavior 
with unix commands doing recursive deletes like {*}rm -r{*}.

For this Jira, I would expect that the command continues to delete the keys 
that it has the permission to do so but returns a successful response to the 
client only if all keys have been successfully deleted.

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