Chung-En Lee created HDDS-17893:
-----------------------------------
Summary: S3G should return Content-Type application/x-directory
for FSO directory keys
Key: HDDS-17893
URL: https://issues.apache.org/jira/browse/HDDS-17893
Project: Apache Ozone
Issue Type: Improvement
Components: S3
Reporter: Chung-En Lee
In FSO buckets, S3G exposes every directory, including implicit parents, as a
{{dir/}} object: HEAD returns 200 and listings include it (HDDS-7922). The
response looks like an empty file: Content-Type {{binary/octet-stream}}, length
0. The only difference is the missing ETag, which directory detection such as
Presto's does not check.
Clients that rely on the {{application/x-directory}} marker convention (also
written by S3A) classify these directories as files. Example: Flink's Presto S3
filesystem ({{s3p://}}) reads a savepoint directory as a 0-byte file, and
restore fails with NoSuchKey.
Reproduce on 2.2.2:
{code}ozone sh bucket create /s3v/fso-bucket --layout FILE_SYSTEM_OPTIMIZED
aws s3api put-object --bucket fso-bucket --key dir/file.txt --body hello.txt
aws s3api head-object --bucket fso-bucket --key dir/
# 200, ContentType binary/octet-stream, ContentLength 0, no ETag
{code}
The same HEAD on an OBS bucket returns 404.
Proposal: return {{Content-Type: application/x-directory}} for FSO directory
keys ({{!key.isFile()}}) in HEAD and GET. S3A detects directories without
checking Content-Type, so it should be unaffected.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]