Skip to content

Conversation

@xBis7
Copy link
Contributor

@xBis7 xBis7 commented Dec 18, 2023

What changes were proposed in this pull request?

When doing a listStatus on a volume, we are setting the volume owner as the resource owner. Therefore, ozone fs -ls is resulting in displaying the volume owner as the owner of every bucket.

Check the jira description for a test-case for manually reproducing it.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9950

How was this patch tested?

A new test was added under TestRootedOzoneFileSystem. The patch was also tested manually in ozone docker dev env like so

> pwd
/projects/ozone/hadoop-ozone/dist/target/ozone-1.5.0-SNAPSHOT/compose/ozone

  // Start docker env
> docker-compose up --scale datanode=5 -d

  // Create volume with the default user, hadoop
> docker-compose exec om ozone sh volume create /vol1

  // Create bucket and set the owner as testuser
> docker-compose exec om ozone sh bucket create /vol1/bucket1 --user testuser 

  // Create bucket and set the owner as testuser2
> docker-compose exec om ozone sh bucket create /vol1/bucket2 --user testuser2 

  // fs -ls
> docker-compose exec om ozone fs -ls /vol1                
Found 2 items
drwxrwxrwx   - testuser  testuser           0 2023-12-18 16:57 /vol1/bucket1
drwxrwxrwx   - testuser2 testuser2          0 2023-12-18 16:57 /vol1/bucket2

  // update the volume owner
> docker-compose exec om ozone sh volume update --user testuser /vol1
{
  "metadata" : { },
  "name" : "vol1",
  "admin" : "hadoop",
  "owner" : "testuser",
  "quotaInBytes" : -1,
  "quotaInNamespace" : -1,
  "usedNamespace" : 2,
  "creationTime" : "2023-12-18T16:57:07.500Z",
  "modificationTime" : "2023-12-18T16:57:40.318Z",
  "acls" : [ {
    "type" : "USER",
    "name" : "hadoop",
    "aclScope" : "ACCESS",
    "aclList" : [ "ALL" ]
  }, {
    "type" : "GROUP",
    "name" : "hadoop",
    "aclScope" : "ACCESS",
    "aclList" : [ "ALL" ]
  } ],
  "refCount" : 0
}

  // fs -ls
> docker-compose exec om ozone fs -ls /vol1
Found 2 items
drwxrwxrwx   - testuser  testuser           0 2023-12-18 16:57 /vol1/bucket1
drwxrwxrwx   - testuser2 testuser2          0 2023-12-18 16:57 /vol1/bucket2

@kerneltime kerneltime self-requested a review December 18, 2023 17:06
@kerneltime
Copy link
Contributor

cc @SaketaChalamchala

Copy link
Member

@aswinshakil aswinshakil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for woking on this fix @xBis7. I have a minor suggestion. Otherwise LGTM.

@adoroszlai adoroszlai requested a review from smengcl December 19, 2023 17:50
@SaketaChalamchala
Copy link
Contributor

Thanks for woking on this fix @xBis7. LGTM

@aswinshakil
Copy link
Member

Thanks for the fix @xBis7. Thanks for the review @SaketaChalamchala

@aswinshakil aswinshakil merged commit 077e09b into apache:master Dec 20, 2023
@xBis7
Copy link
Contributor Author

xBis7 commented Dec 20, 2023

Thanks @aswinshakil @SaketaChalamchala for the review.

adoroszlai pushed a commit to adoroszlai/ozone that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants