You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Tanvi Penumudy (Jira)" <ji...@apache.org> on 2025/04/29 07:03:00 UTC

[jira] [Commented] (HDDS-12930) 'fs -ls' allows listing keys for OBS bucket type

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

Tanvi Penumudy commented on HDDS-12930:
---------------------------------------

The key listing operation was restricted previously when called on OBS buckets (an IllegalArgumentException was thrown).

The patch ([https://github.com/apache/ozone/pull/6988]) skips the getBucket() call when we obtain the OzoneFileStatus of a key (uses RPCClient#getOzoneFileStatus directly instead of OzoneBucket#getFileStatus), but this also results in the skipping of the OzoneFSUtils#validateBucketLayout check on the OFS client-side allowing for the listing of the OBS bucket keys using FS API.

We can restrict the operation from the client-side by making the getBucket() call (an additional round trip to OM to obtain this layout information - that the patch skips).

Therefore, I think the only way to go about this is to revert the patch.

On the server-side, we do not perform any such validations. Therefore, it's not possible to address this situation without having to change the server-side behaviour (if we want to avoid the additional getBucket() call on the client-side).

> 'fs -ls' allows listing keys for OBS bucket type
> ------------------------------------------------
>
>                 Key: HDDS-12930
>                 URL: https://issues.apache.org/jira/browse/HDDS-12930
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: Ozone Filesystem
>    Affects Versions: 2.0.0
>            Reporter: Tanvi Penumudy
>            Assignee: Tanvi Penumudy
>            Priority: Major
>
> FS API ('fs -ls' command) allows listing keys under an OBS bucket:
> {code:java}
> bash-4.4$ ozone sh bucket info vol1/buck1
> {
>   "metadata" : \{ },
>   "volumeName" : "vol1",
>   "name" : "buck1",
>   "storageType" : "DISK",
>   "versioning" : false,
>   "listCacheSize" : 1000,
>   "usedBytes" : 15892,
>   "usedNamespace" : 1,
>   "creationTime" : "2025-04-29T06:02:09.195Z",
>   "modificationTime" : "2025-04-29T06:02:09.195Z",
>   "sourcePathExist" : true,
>   "quotaInBytes" : -1,
>   "quotaInNamespace" : -1,
>   "bucketLayout" : "OBJECT_STORE",
>   "owner" : "hadoop",
>   "link" : false
> }
> bash-4.4$ ozone fs -ls ofs://om/vol1/buck1/testfile
> -rw-rw-rw-   1 hadoop hadoop      15892 2025-04-29 06:02 ofs://om/vol1/buck1/testfile
> {code}
> The same is not allowed at the bucket-level:
> {code:java}
> bash-4.4$ ozone fs -ls ofs://om/vol1/buck1
> -ls: Bucket: buck1 has layout: OBJECT_STORE, which does not support file system semantics. Bucket Layout must be FILE_SYSTEM_OPTIMIZED or LEGACY.
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org