Skip to content

HDDS-17319. Ignore decoded content length for non-streaming PutObject - #11714

Open
andyhuangdev wants to merge 1 commit into
apache:masterfrom
andyhuangdev:HDDS-17319
Open

andyhuangdev wants to merge 1 commit into
apache:masterfrom
andyhuangdev:HDDS-17319

Conversation

@andyhuangdev

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

S3 Gateway parses x-amz-decoded-content-length during PutObject directory detection, even for non-streaming uploads. Non-numeric or overflowing values cause a NumberFormatException and an HTTP 500 response.

This change limits decoded content length parsing to streaming uploads, preserving existing streaming behavior. Non-streaming uploads ignore the header and use Content-Length, matching the Amazon S3 behavior reported in the Jira. It also prevents a decoded length of 0 from incorrectly triggering FSO directory creation for non-empty uploads.

What is the link to the Apache JIRA

HDDS-17319

How was this patch tested?

Added regression tests covering ignored decoded content length values for non-streaming uploads and preventing incorrect FSO directory creation.

All 112 tests in TestObjectPut passed:

mvn -pl :ozone-s3gateway test -Dtest=TestObjectPut -DskipShade -DskipRecon -DskipDocs

Checkstyle passed:

./hadoop-ozone/dev-support/checks/checkstyle.sh

@github-actions github-actions Bot added the s3 S3 Gateway label Oct 23, 2026
@smengcl
smengcl marked this pull request as ready for review October 24, 2026 05:41
Copilot AI lite review requested due to automatic review settings October 24, 2026 05:42

@smengcl smengcl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks for the patch. I would like to defer merging this after #11735, which will (hopefully) allow skipping most integration tests for S3-only changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s3 S3 Gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants