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

Avoid metadata requests talking to GCS #347

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Avoid metadata requests talking to GCS #347

merged 1 commit into from
Sep 16, 2024

Conversation

Swatinem
Copy link
Contributor

@Swatinem Swatinem commented Sep 5, 2024

The GCS Storage would previously fetch the bucket metadata using get_bucket, where a call to bucket is sufficient to create the python class without doing a request.


fixes codecov/engineering-team#2276

@Swatinem Swatinem self-assigned this Sep 5, 2024
@Swatinem Swatinem requested a review from a team September 5, 2024 13:27
joseph-sentry
joseph-sentry previously approved these changes Sep 5, 2024
@Swatinem
Copy link
Contributor Author

Swatinem commented Sep 9, 2024

Interesting, I now noticed the metadata updates in a trace for the first time:

image

The GCS Storage would previously fetch the bucket metadata using `get_bucket`, where a call to `bucket` is sufficient to create the python class without doing a request.
@Swatinem
Copy link
Contributor Author

I updated this with some of the learnings from #351.

This should now be a "minimally invasive" version.

It avoids the needless bucket metadata calls, but otherwise keeps the file metadata call as-is because of the gzip oddity.

I also hand-edited the cassette files to remove the bucket metadata calls from them, and to remove some obsolete ones, but the tests would function even without that update.

@Swatinem Swatinem requested a review from a team September 13, 2024 12:17
@Swatinem Swatinem added this pull request to the merge queue Sep 16, 2024
Merged via the queue into main with commit 8650a3c Sep 16, 2024
6 checks passed
@Swatinem Swatinem deleted the swatinem/gcp-meta branch September 16, 2024 08:28
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.11%. Comparing base (d26f241) to head (cfc3232).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #347      +/-   ##
==========================================
- Coverage   89.78%   89.11%   -0.68%     
==========================================
  Files         375      324      -51     
  Lines       11638     9698    -1940     
  Branches     2063     1735     -328     
==========================================
- Hits        10449     8642    -1807     
+ Misses       1101      992     -109     
+ Partials       88       64      -24     
Flag Coverage Δ
shared-docker-uploader ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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.

Avoid excess requests on ArchiveService.{read,write}_file
4 participants