feat(storage): Add full object checksum validation for appendable uploads#16219
feat(storage): Add full object checksum validation for appendable uploads#16219v-pratap wants to merge 19 commits into
Conversation
3aad347 to
915cef5
Compare
There was a problem hiding this comment.
Code Review
This pull request adds support for CRC32C checksum validation during asynchronous uploads, specifically during finalization, resume, and flush operations. It updates the AsyncWriter interface and its underlying connection implementations to accept and verify expected checksums, and enhances HashFunction to support state retrieval and restoration. The review feedback highlights three critical issues: a compilation error in AsyncWriterConnectionImpl::Finalize caused by inconsistent return types in a lambda, and two data races in AsyncWriterConnectionResumed where impl_ is accessed concurrently without holding the appropriate mutex lock.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #16219 +/- ##
==========================================
- Coverage 92.27% 92.25% -0.02%
==========================================
Files 2214 2214
Lines 206394 206332 -62
==========================================
- Hits 190443 190350 -93
- Misses 15951 15982 +31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
006eeda to
9fca72d
Compare
| future<StatusOr<google::storage::v2::Object>> Finalize(AsyncToken token); | ||
| future<StatusOr<google::storage::v2::Object>> Finalize( | ||
| AsyncToken token, | ||
| absl::optional<Crc32cChecksumValue> const& expected_checksum); |
There was a problem hiding this comment.
nit: https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs recommends avoiding absl::optional<T> const&.
If possible, we should either pass std::optional<T> by value (if it's a by-value input) or pass const T* (if it would otherwise be passed by reference).
… in appendable uploads
…overloads without default arguments
…ck slice calculations
…tate to avoid offset rewinding and MD5 errors
…heckpoints during a stream resume
…ose() phases as per revised design
Based on the revised design, full-object checksum verification is exclusively handled server-side at Finalize(), eliminating the need for continuous client-side incremental hashing across the stream. - Removed dynamic hash computation from CreateHashFunction for all async writers. - Removed dead client-side mismatch checking in AsyncWriterConnectionImpl and AsyncWriterConnectionResumed. - Consolidated appendable and standard hash creation to use PrecomputedHashFunction only. - Cleaned up obsolete tests asserting client-side hash mismatch failures.
255bfa1 to
299f716
Compare
299f716 to
b8eafc4
Compare
No description provided.