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

GC: correctly handle manifest unknown (404) condition in v2DeleteManifest retry loop #18386

Merged
merged 2 commits into from Apr 12, 2023

Conversation

dkulchinsky
Copy link
Contributor

@dkulchinsky dkulchinsky commented Mar 21, 2023

Comprehensive Summary of your change

Currently when a 404 error is returned from the registry in v2DeleteManifest retry loop, it will be considered is a temporary/retryable error and will eventually result in the v2DeleteManifest step to fail, although a 404 (MANIFEST_UNKNOWN) indicates that the manifest no longer exists.

This PR adds a check inside the retry loop that marks the v2DeleteManifest as success if registry returns a 404.

This change seem to correctly align with the next cleanup step that deletes all the manifests revisions using RegistryCtl which also treats a 404 error as success.

Issue being fixed

Fixes #18381

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #18386 (33b1d7c) into main (b201f98) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18386      +/-   ##
==========================================
- Coverage   67.39%   67.38%   -0.01%     
==========================================
  Files         984      984              
  Lines      106987   106990       +3     
  Branches     2670     2670              
==========================================
- Hits        72101    72099       -2     
- Misses      31005    31012       +7     
+ Partials     3881     3879       -2     
Flag Coverage Δ
unittests 67.38% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/jobservice/job/impl/gc/util.go 26.92% <0.00%> (-1.65%) ⬇️

... and 8 files with indirect coverage changes

@OrlinVasilev OrlinVasilev added the release-note/update Update or Fix label Mar 22, 2023
@dkulchinsky dkulchinsky force-pushed the dannyk/gc_handle_manifest_unknown branch from 7bd1136 to de9ae08 Compare March 26, 2023 23:39
Signed-off-by: Danny Kulchinsky <dkulchinsky@fastly.com>
@dkulchinsky dkulchinsky force-pushed the dannyk/gc_handle_manifest_unknown branch from de9ae08 to 9489ea5 Compare March 27, 2023 17:42
@dkulchinsky
Copy link
Contributor Author

Hey @Vad1mo, @wy65701436 was wondering if you had a chance to consider this PR?

I have a local build with this change running on our test Harbor and it is working very well, we're finally able to get GC running and actually cleaning up all these manifests & blobs.

@dkulchinsky
Copy link
Contributor Author

Thanks for approving @zyyw!

I updated the branch, let me know if there's anything else needed to get this merged.

@Vad1mo Vad1mo merged commit 14e4c07 into goharbor:main Apr 12, 2023
10 of 12 checks passed
@dkulchinsky
Copy link
Contributor Author

dkulchinsky commented Apr 13, 2023

Thanks @Vad1mo & @zyyw!

I wonder if it's possible to backport/cherry-pick this change to v2.7? I realize v2.8 is almost out but we're not quite ready to upgrade yet as we're still working on our chartmuseum deprecation and would be great if we we could have this fix v2.7 for now

@Vad1mo
Copy link
Member

Vad1mo commented Apr 14, 2023

Good question, would make sense as it is a fix.
I would recommend to back port it yourself to 2.7 and 2.8. Open a PR for that so that it can land in 2.7.2 or 2.8.1

@dkulchinsky
Copy link
Contributor Author

@Vad1mo, @zyyw cherry picked this into release-2.7.0 branch: #18534 🙏🏼

@Vad1mo
Copy link
Member

Vad1mo commented Apr 17, 2023

you should also make one for the 2.8 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

GC retries forever on permanent errors, most commonly on "manifest unknown" (404)
7 participants