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

feat(storage/transfermanager): checksum full object downloads #10569

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

BrennaEpp
Copy link
Contributor

No description provided.

@BrennaEpp BrennaEpp requested review from a team as code owners July 21, 2024 03:27
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jul 21, 2024
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

In general looks really good, a few minor questions/comments. Also, could you add a note to the docs to indicate under what circumstances checksumming will be performed?

@@ -31,6 +33,12 @@ import (
"google.golang.org/api/iterator"
)

// maxChecksumZeroArraySize is the maximum amount of memory to allocate for
// updating the checksum. A larger size will occupy more memory but will require
// more updates when computing the crc32c of a full object.
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems wrong, I would imagine larger means fewer updates?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, I messed up that wording.


// joinCRC32C pieces together the initial checksum with the orderedChecksums
// provided to calculate the checksum of the whole.
func joinCRC32C(initialChecksum uint32, orderedChecksums []crc32cPiece) uint32 {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems surprising that this isn't available in hash/crc32 or elsewhere in a standard library, but I assume you looked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, there was a feature request for it a while back but they considered it not common enough a use-case to include in the standard library: golang/go#12297

storage/transfermanager/downloader.go Outdated Show resolved Hide resolved
storage/transfermanager/downloader.go Show resolved Hide resolved
storage/transfermanager/downloader.go Outdated Show resolved Hide resolved
@BrennaEpp BrennaEpp requested a review from tritone July 30, 2024 00:01
@BrennaEpp BrennaEpp enabled auto-merge (squash) July 30, 2024 18:48
@BrennaEpp BrennaEpp merged commit c366c90 into googleapis:main Jul 30, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants