AWS: Add properties to configure SDK request checksum calculation and response checksum validation - #17177
AWS: Add properties to configure SDK request checksum calculation and response checksum validation#17177moomindani wants to merge 3 commits into
Conversation
|
Not stale — this has had no review yet. CI is green (40/40). Adds two S3FileIO properties for the checksum behavior introduced in AWS SDK 2.30.0 ( Context: this is the fix for #14439, where the SDK's default @nastra @singhpk234 @amogh-jahagirdar you've been handling recent AWS changes — would any of you have time for a review? |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Decouple the SDK checksum behavior from s3.checksum-enabled and expose s3.request-checksum-calculation and s3.response-checksum-validation directly. When unset, the AWS SDK defaults are left unchanged, so this introduces no behavior change; users of S3-compatible storage can opt out with when_required.
fba4175 to
3e0d46a
Compare
|
@danielcweeks would you be willing to take a look? This is the S3FileIO side of #14439 (S3-compatible stores rejecting the SDK's CRC32 trailer headers), reviving #15391 by @rcjverhoef with his commit preserved. It has been open six weeks without a review; I rebased it onto current The part I would most like a maintainer's read on is the default. This PR deliberately leaves the AWS SDK defaults in place when the properties are unset, so there is no behavior change and #17179 stacks on this one and adds |
|
@singhpk234 I mentioned you here on 7 August along with two others, so apologies for coming back — this time I have a more specific reason to ask you in particular. #15242, which you merged in April, is the same shape as this PR: an What this does: since SDK 2.30.0 the default The one question I would rather not settle myself is the default: keep the SDK default, as this PR does, so there is no behavior change and A correction to my earlier comments here: I wrote that #17179 stacks on this PR and should wait for it. That is wrong. #17179 branches from @steveloughran you pointed at the S3A settings on #14439 back in April; this is the Iceberg-side equivalent, and your view on which default is right would be valuable. |
…patibility example
|
@CTTY would you be able to review this one? You merged #16794 and #16853 in the AWS module, and this PR has had no review since it was opened on 12 July. To make it easier to say yes, I am withdrawing the design question I raised earlier in this thread. This PR leaves every AWS SDK default untouched when the new properties are unset, so there is no behavior change and Why it matters: on #14439, users on Dell ECS and the GCS S3-compatible API have no in-Iceberg way out today. @patricklucas pinned the AWS SDK back to 2.29.52 in April to get PUTs working, and the only other workaround is the Rebased onto current @danielcweeks to close the loop on my 22 August comment: the default question above is withdrawn from this PR, so there is nothing for you to rule on here. |
This PR adds two new S3FileIO properties to control the AWS SDK checksum behavior introduced in AWS SDK 2.30.0:
s3.request-checksum-calculation: controls when the SDK calculates a checksum for S3 requests (when_supported/when_required)s3.response-checksum-validation: controls when the SDK validates checksums on S3 responses (when_supported/when_required)When a property is not set, the corresponding AWS SDK default (
WHEN_SUPPORTEDsince SDK 2.30.0) is left unchanged, so this PR introduces no behavior change for existing users.Background
Since AWS SDK 2.30.0, the SDK calculates a CRC32 checksum for all requests that support one (
RequestChecksumCalculation.WHEN_SUPPORTEDby default) and sends it asx-amz-sdk-checksum-algorithm/x-amz-trailer: x-amz-checksum-crc32headers. Some S3-compatible object stores (e.g. Dell ECS, GCS S3-compatible API) reject these headers, which breaks writes through S3FileIO. S3FileIO currently has no way to configure this SDK behavior;s3.checksum-enabledonly controls the legacy Content-MD5 checksum. Settings3.request-checksum-calculation=when_requiredstops the SDK from sending these headers.This revives and reworks #15391 by @rcjverhoef (thanks!), preserving the original commit. The rework decouples the new knobs from
s3.checksum-enabledinto standalone properties that follow the SDK defaults when unset.Design notes
when_requiredfor better out-of-the-box compatibility with S3-compatible stores would be a behavior change and can be discussed separately on the dev list.s3.checksum-algorithmproperty to select the checksum algorithm per request.Testing
TestS3FileIOPropertiesfor parsing, defaults (unset leaves SDK defaults untouched), and builder applicationx-amz-sdk-checksum-algorithm: CRC32andx-amz-trailer: x-amz-checksum-crc32; withwhen_requiredno checksum headers are sent. S3FileIO write/read/delete succeed under both settings.Fixes #14439