Skip to content

Conversation

@BenWhitehead
Copy link
Collaborator

Storage#createFrom and Storage#writer allow specifying an explicit crc32c value which should be passed to GCS for validation. Update our uploads to allow these explicitly defined values to be passed in the finish_write message to GCS.

Update UnifiedOpts.Crc32cValue to represent its value as an int rather than the b64 string from apiary. Internally when the value is necessary for apiary it will be converted to the b64 string representation.

Map gRPC Status DATA_LOSS to HTTP 400 Bad Request to mirror the behavior of JSON when a checksum validation fails.

Add a new Hasher.constant instant which will function to specify a constant value for the cumulative value of a write.

Various plumbing tweaks to allow passing this value all the way down and also attempting to "nullSafeConcat"

Add new integration tests to try the negative case to ensue we are getting checksum failures when we pass mismatch values and content.

…rc32c value

Storage#createFrom and Storage#writer allow specifying an explicit crc32c value which should be passed to GCS for validation. Update our uploads to allow these explicitly defined values to be passed in the `finish_write` message to GCS.

Update UnifiedOpts.Crc32cValue to represent its value as an int rather than the b64 string from apiary. Internally when the value is necessary for apiary it will be converted to the b64 string representation.

Map gRPC Status `DATA_LOSS` to HTTP 400 Bad Request to mirror the behavior of JSON when a checksum validation fails.

Add a new Hasher.constant instant which will function to specify a constant value for the cumulative value of a write.

Various plumbing tweaks to allow passing this value all the way down and also attempting to "nullSafeConcat"

Add new integration tests to try the negative case to ensue we are getting checksum failures when we pass mis-match values and content.
@BenWhitehead BenWhitehead requested a review from a team as a code owner October 6, 2022 21:53
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels Oct 6, 2022
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

LGTM, just have one question about error code mapping to HTTP 1.1 errors

case ABORTED: // ?
case CANCELLED: // ?
case UNKNOWN: // ?
case DATA_LOSS: // ?
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the ? TODO's that need to be finished before cutting a relaese?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hopefully, they're being tracked in the tracker. However, ABORTED, CANCELLED, UNKNOWN probably fall into the "connection errors" bucket we've got for http.

@BenWhitehead BenWhitehead merged commit e6b12a7 into feat/grpc-storage Oct 7, 2022
@BenWhitehead BenWhitehead deleted the grpc/write-checksum-validation branch October 7, 2022 16:39
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 googleapis/java-storage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants