fix(distribution): Backport distribution fix 'add bounded concurrency for tag lookup and untag #21652
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Comprehensive Summary of your change
Hello,
Investigating about a garbage collection taking months/years to finish, I checked the GC logs and found out that the manifest deletion always took ~30s.
So I asked if some people had the same issue on slack and I found the issue #12948 talking about it and linking to a docker distribution PR fixing the issue.
Problem is that it will be probably only be released on Distribution v3 while this version is still in working state after years of work, that's why I decided to cherry-pick the fix distribution/distribution#4329 written by @microyahoo to improve garbage collection manifest deletion.
I tested the fix, and I went from 30s to ~7s to delete a manifest.
A new configuration has been added on distribution configuration side to configure tag deletion concurrency limit, by default it's set to
runtime.GOMAXPROCS(0)
, so it's working without having to modify docker distribution configuration (no need to modify the Helm Chart).Issue being fixed
Fixes #12948
Please indicate you've done the following: