Dont download whole GCP objects in clean up task
What does this MR do and why?
This resolves the memory problem we encountered in gitlab-com/gl-infra/production#17625 (comment 1897993299).
For GCP object storage provider, we had to fetch the object to be able to track the last generation attribute value before we delete it. This is needed by the rollback rake task if ever.
We encountered memory usage issues when executing this because the call
to artifacts_directory.files.get
would download the whole object
including the content which ended up problematic for large artifact
objects.
The fix here is to just use artifacts_directory.files.metadata
, which
is only available for fog-google
, so that it will only download the
object metadata.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.