Skip to content

Conversation

@hssyoo
Copy link
Contributor

@hssyoo hssyoo commented Sep 10, 2025

Ports this reference Rust implementation: https://lenain.info/crc32-combine-in-rust/

This PR implements a function to combine 2 CRC32-computed values (ie CRC32(A) + CRC32(B)) to produce a single CRC32 value that is equal to CRC32(A+B). For example, the combination CRC32(foo) + CRC32(bar) would be equal to CRC32(foobar).

The purpose of this function is to enable parallel checksum calculation when uploading/downloading an object across multiple parts. Using a single running checksum object that all parts must update would cause head-of-line blocking, forcing already uploaded/downloaded parts to persist in memory while waiting to update the checksum object. Instead, the combine function allows each part to have its own checksum object, which are then serially combined at the end to produce a single full object checksum.

combine_crc32 takes as input CRC32 integer values that are available in botocore's Crc32Checksum class: https://github.com/boto/botocore/blob/d3ade36d635a2b6a89229b199234afc52f9bcf55/botocore/httpchecksum.py#L82, which will be exposed in followup PRs.

Example usage of this function can be seen in a draft PR: aws/aws-cli#9660

@hssyoo hssyoo requested a review from jonathan343 September 10, 2025 19:27
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 97.67442% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (full-object-checksum@44a8fb2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
s3transfer/checksums.py 97.67% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@                   Coverage Diff                   @@
##             full-object-checksum     #359   +/-   ##
=======================================================
  Coverage                        ?   81.56%           
=======================================================
  Files                           ?       17           
  Lines                           ?     2984           
  Branches                        ?        0           
=======================================================
  Hits                            ?     2434           
  Misses                          ?      550           
  Partials                        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hssyoo hssyoo merged commit cda2f59 into boto:full-object-checksum Oct 14, 2025
37 checks passed
@hssyoo hssyoo deleted the full-object-checksum branch October 14, 2025 15:05
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