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

fix(GCS+gRPC): handle offsets in Hash*::Update() #14567

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Jul 25, 2024

When reading data from GCS we don't necessarily know the initial offset.
Reading the last N bytes is expressed as a negative offset in the
request, and the returned offset is not known until the first message.
But once the offset is known, receiving out of order data indicates a
bug in the client library, and should be detected.

The code was assuming the initial offset was always 0.


This change is Reviewable

When reading data from GCS we don't necessarily know the initial offset.
Reading the last N bytes is expressed as a negative offset in the
request, and the returned offset is not known until the first message.
But once the offset is known, receiving out of order data indicates a
bug in the client library, and should be detected.

The code was assuming the initial offset was always 0.
@coryan coryan marked this pull request as ready for review July 25, 2024 16:33
@coryan coryan requested review from a team as code owners July 25, 2024 16:33
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.58%. Comparing base (ad1d045) to head (9e039c9).
Report is 93 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14567   +/-   ##
=======================================
  Coverage   93.57%   93.58%           
=======================================
  Files        2318     2318           
  Lines      207115   207177   +62     
=======================================
+ Hits       193816   193893   +77     
+ Misses      13299    13284   -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @coryan)

@coryan coryan merged commit ee21b70 into googleapis:main Jul 25, 2024
67 checks passed
@coryan coryan deleted the fix-storage-handle-offsets-in-hash-functions branch July 25, 2024 17:04
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.

2 participants