-
Notifications
You must be signed in to change notification settings - Fork 260
feat: Implement trailing checksum in connector #1611
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
base: master
Are you sure you want to change the base?
Conversation
|
/gcbrun |
Summary of ChangesHello @dheerajsngh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Google Cloud Storage connector by implementing a trailing checksum mechanism for data uploads. This feature allows for server-side validation of data integrity by including a CRC32C checksum in the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a valuable feature for ensuring data integrity by implementing trailing checksum validation for uploads. The changes are well-structured, introducing a new configuration option, updating the write channel logic to compute checksums, and using an HTTP interceptor to add the checksum header to the final upload request. The use of a ThreadLocal to pass the hasher context is a clean solution, and the inclusion of comprehensive unit and integration tests is commendable. I've found one minor issue in a test file that I've commented on.
| config.set("fs.gs.write.parallel.composite.upload.part.file.cleanup.type", "NEVER"); | ||
| config.set("fs.gs.write.parallel.composite.upload.part.file.name.prefix", "baz"); | ||
| config.setBoolean("fs.gs.write.rolling.checksum.enable", true); | ||
| config.setBoolean("fs.gs.write.trailing.checksum", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the configuration key. It should be fs.gs.write.trailing.checksum.enable instead of fs.gs.write.trailing.checksum. The test currently passes because the default value is false, which matches the assertion. However, it's not correctly testing the configuration property. Using the constant GCS_WRITE_TRAILING_CHECKSUM_ENABLE.getKey() would be a safer way to avoid such typos.
| config.setBoolean("fs.gs.write.trailing.checksum", false); | |
| config.setBoolean("fs.gs.write.trailing.checksum.enable", false); |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1611 +/- ##
============================================
+ Coverage 81.90% 81.91% +0.01%
- Complexity 2425 2432 +7
============================================
Files 128 130 +2
Lines 10819 10849 +30
Branches 1302 1307 +5
============================================
+ Hits 8861 8887 +26
- Misses 1415 1416 +1
- Partials 543 546 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
PR enables server-side data integrity validation for GCS uploads. It calculates the CRC32C checksum on the client side and sends it as a trailing header (x-goog-hash) with the final upload request, allowing GCS to validate the data before finalizing the object.
Key Changes
fs.gs.write.trailing.checksum.enable(default: false) to control the feature.Verification
More Details in the Doc: go/enable-crc32c-in-gcs-connector