Repository navigation
HDDS-17893. S3G should return Content-Type application/x-directory for FSO directory keys - #12147
Open
yandrey321 wants to merge 2 commits into
Open
yandrey321 wants to merge 2 commits into
yandrey321 wants to merge 2 commits into
Conversation
…r FSO directory keys Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
yandrey321
marked this pull request as draft
November 24, 2026 09:03
yandrey321
marked this pull request as ready for review
December 1, 2026 03:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Problem
In FSO buckets, S3 Gateway exposes every directory, including implicit parents, as a
dir/object (HDDS-7922).HEAD and GET on it return 200 with
Content-Type: binary/octet-stream, length 0 and no ETag, so it looks like anempty file. Clients that recognize directories by the
application/x-directorymarker, such as Flink's Presto-basedS3 filesystem (
s3p://), therefore treat these directories as files. Restoring a Flink savepoint stored in an FSObucket fails with
NoSuchKey.Implementation idea
ObjectEndpoint.contentTypeOf()now returnsapplication/x-directorywhen the key is not a file(
!key.isFile()). HEAD and GET both get their Content-Type from this helper, so both responses change.Key decisions
OzoneKey.isFile(), the same signalEndpointBase.validateFileKeyalready uses.The OM sets it to false only for FSO directories and forces it to true for every OBS and legacy key.
application/x-directory, even if Content-Type metadata is stored on it. This givesclients one consistent signal, including for implicit parent directories that have no metadata.
response-content-typequery parameter still overrides the value on GET, as for any other object.unaffected.
Side effects
isFileflag arrived with thegetKeyInfoOM call that S3G uses (HDDS-7419), soevery OM that answers that call sets it.
Co-authored-by: Claude Opus 5.5 noreply@anthropic.com
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17893
How was this patch tested?
Unit + integration tests.