Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling upload checksums while using upload review #421

Merged
merged 6 commits into from
Apr 10, 2024

Conversation

jamesbornholt
Copy link
Member

Some clients (Mountpoint) might want to disable actually sending upload
checksums when talking to S3 endpoints that don't support the additional
checksums feature. But they still want to use the upload review callback
to at least check that the parts sent matched the checksums they expect,
to detect corruption while parts were sitting in CRT memory before being sent.
This change makes it possible to set a checksum location of AWS_SCL_NONE
while still computing checksums for each upload part. The upload review
callback will be invoked as normal, including per-part checksums, but the
checksums won't be included in the requests sent to S3.

(My C is pretty rusty these days, so, uh, feedback welcome)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Some clients (Mountpoint) might want to disable actually sending upload
checksums when talking to S3 endpoints that don't support the additional
checksums feature. But they still want to use the upload review callback
to at least check that the parts sent matched the checksums they expect.
This change makes it possible to set a checksum location of AWS_SCL_NONE
while still computing checksums for each upload part. The upload review
callback will be invoked as normal, but the checksums won't be included
in the requests sent to S3.

Signed-off-by: James Bornholt <bornholt@amazon.com>
Signed-off-by: James Bornholt <bornholt@amazon.com>
Before we were relying on the chunk stream to reach the end of its inner
checksum stream and then immediately destroy the checksum stream,
triggering the checksum finalizer. We need to do the same thing in the
non-chunk-stream case.

Signed-off-by: James Bornholt <bornholt@amazon.com>
@jamesbornholt jamesbornholt marked this pull request as ready for review March 29, 2024 18:49
Copy link
Contributor

@waahm7 waahm7 left a comment

Choose a reason for hiding this comment

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

Thank you for creating the PR. I have made a small change to finalize error handling since now it can finalize in the read_callback. LGTM!

Copy link
Contributor

@TingDaoK TingDaoK left a comment

Choose a reason for hiding this comment

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

trivial stuff.

fix&ship. (if you don't mind, I can fix it for you)

source/s3_checksum_stream.c Outdated Show resolved Hide resolved
source/s3_checksum_stream.c Show resolved Hide resolved
source/s3_checksum_stream.c Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 80.55556% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 89.52%. Comparing base (3334843) to head (4efc4e4).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
- Coverage   89.63%   89.52%   -0.12%     
==========================================
  Files          20       20              
  Lines        5992     6012      +20     
==========================================
+ Hits         5371     5382      +11     
- Misses        621      630       +9     
Files Coverage Δ
source/s3_auto_ranged_put.c 92.77% <100.00%> (+0.02%) ⬆️
source/s3_client.c 88.15% <100.00%> (ø)
source/s3_request_messages.c 73.97% <84.21%> (+0.22%) ⬆️
source/s3_checksum_stream.c 74.07% <71.42%> (-0.40%) ⬇️

... and 2 files with indirect coverage changes

@TingDaoK TingDaoK merged commit f222ada into main Apr 10, 2024
30 checks passed
@TingDaoK TingDaoK deleted the bornholt/disable-checksum-headers branch April 10, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants