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

[COST-5216] Delete filtering optimization #5197

Merged
merged 2 commits into from
Jul 2, 2024
Merged

Conversation

myersCody
Copy link
Contributor

Jira Ticket

COST-5216

Description

This change will switch us to using head_object to download only the metadata during the delete filtering instead of the s3 object. This will save us some time since we will no longer need to spend cycles retrieving the additional attributes available to the object from s3 such as the ACL, owner, storage type, etc.

Testing

I wrote a little test script we can use for this:
https://gist.github.com/myersCody/0c57dc2132a7a712c035ae1210c30d20

Output:

TEST NOT MATCHING
------
2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/
Metadata: {}


------
2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/0d34ec6a-1cab-4c89-a03e-cb471c0ba067.csv
Metadata: {'test-key': '1'}


------
2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/0d34ec6a-1cab-4c89-a03e-cb471c0ba067.csv.metadata
Metadata: {}


['2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/', '2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/0d34ec6a-1cab-4c89-a03e-cb471c0ba067.csv.metadata']
TEST MATCHING
------
2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/
Metadata: {}


------
2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/0d34ec6a-1cab-4c89-a03e-cb471c0ba067.csv
Metadata: {'test-key': '1'}


------
2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/0d34ec6a-1cab-4c89-a03e-cb471c0ba067.csv.metadata
Metadata: {}


['2023/04/30/a678b047-f78e-4ad8-9fbe-1e3b73bd5a24/0d34ec6a-1cab-4c89-a03e-cb471c0ba067.csv']

Release Notes

  • proposed release note
* [COST-5216](https://issues.redhat.com/browse/COST-5216) Optimize delete filtering logic to only collect necessary metadata

@myersCody myersCody requested review from a team as code owners July 1, 2024 19:16
@myersCody myersCody added the aws-smoke-tests pr_check will build the image and run aws + ocp on aws smoke tests label Jul 1, 2024
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.2%. Comparing base (abd4261) to head (9240cc1).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #5197   +/-   ##
=====================================
  Coverage   94.2%   94.2%           
=====================================
  Files        376     376           
  Lines      31252   31254    +2     
  Branches    3734    3734           
=====================================
+ Hits       29426   29431    +5     
+ Misses      1163    1160    -3     
  Partials     663     663           

@lcouzens lcouzens merged commit 97ba98e into main Jul 2, 2024
11 checks passed
@lcouzens lcouzens deleted the COST-5216-head-object branch July 2, 2024 12:18
myersCody added a commit that referenced this pull request Jul 2, 2024
myersCody added a commit that referenced this pull request Jul 2, 2024
djnakabaale pushed a commit that referenced this pull request Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-smoke-tests pr_check will build the image and run aws + ocp on aws smoke tests smokes-required
Projects
None yet
3 participants