Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@south-mer
Copy link
Contributor

@south-mer south-mer commented Jun 20, 2025

What is the problem I am trying to address?

Continuing the GCP storage backend lock removal, this PR aims to prevent regressions in future changes by precomputing the MD5 checksum and passing the checksum when uploading the file.

The computed checksum can be used for any storage provider; however, it is currently only implemented for GCP backend.

How is the fix applied?

  • Further protect against corrupt cache by precomputing the MD5 sum for the ZIP file.
  • Modify the Saver interface to accept the MD5 sum, and clarify the contract between the Saver implementation and the Saver user regarding the MD5 sum.
  • Implement checksum in upload for GCP backend only.
    • Other backends have checksum passed to the implementation, but we did not implement passing the checksum to the upload to prevent breaking existing users since we have no way to test those implementations.

What GitHub issue(s) does this PR fix or close?

We are facing cache corruption in production.

@south-mer south-mer requested a review from a team as a code owner June 20, 2025 09:24
@south-mer south-mer changed the title Add Checksum to Saver (+ GCP implementation) [Stacked] Add Checksum to Saver (+ GCP implementation) Jun 20, 2025
@south-mer south-mer changed the title [Stacked] Add Checksum to Saver (+ GCP implementation) Add Checksum to Saver (+ GCP implementation) Jul 15, 2025
@south-mer
Copy link
Contributor Author

The PR is rebased since the PRs that conflict (#2050, #2051) have been merged.

@nrwiersma nrwiersma requested a review from Ullaakut July 24, 2025 14:25
@nrwiersma
Copy link
Contributor

Please update the branch.

@nrwiersma nrwiersma merged commit 11d674c into gomods:main Aug 6, 2025
12 checks passed
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.

3 participants