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): correctly resume ranged reads #14495

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Jul 18, 2024

Fixes #14494


This change is Reviewable

@coryan coryan marked this pull request as ready for review July 18, 2024 20:04
@coryan coryan requested review from a team as code owners July 18, 2024 20:04
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.59%. Comparing base (eb2cacc) to head (d6b4644).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14495      +/-   ##
==========================================
- Coverage   93.60%   93.59%   -0.01%     
==========================================
  Files        2316     2316              
  Lines      207319   207348      +29     
==========================================
+ Hits       194054   194077      +23     
- Misses      13265    13271       +6     

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

Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

Q: why should we even allow ReadFromOffset and ReadRange together? It is only well defined if offset == range.begin, no?

@coryan
Copy link
Contributor Author

coryan commented Jul 18, 2024

Q: why should we even allow ReadFromOffset and ReadRange together? It is only well defined if offset == range.begin, no?

You could argue that the intersection of ReadFromOffset and ReadRange is reasonably well defined if offset < range.end.

Cleverly (see the air quotes?) the resume loop only sets ReadFromOffset, when/if the application also sets ReadRange we merge both. Not the cleanest design, but a bit tricky to (a) prohibit, given the APIs we do expose, or (b) fix without risking a break for JSON.

Let me consider your proposed fix separately.

@coryan coryan enabled auto-merge (squash) July 18, 2024 22:46
@coryan coryan merged commit a404691 into googleapis:main Jul 18, 2024
63 checks passed
@coryan coryan deleted the fix-GCS+gRPC-correctly-resume-ranged-reads branch July 18, 2024 23:25
cuiy0006 pushed a commit to cuiy0006/google-cloud-cpp that referenced this pull request Jul 22, 2024
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.

GCS+gRPC incorrectly updates the limit for resumed ranged reads
2 participants