distribution/registry/handlers
Liang Zheng a2afe23f38 add concurrency limits for tag lookup and untag
Harbor is using the distribution for it's (harbor-registry) registry component.
The harbor GC will call into the registry to delete the manifest, which in turn
then does a lookup for all tags that reference the deleted manifest.
To find the tag references, the registry will iterate every tag in the repository
and read it's link file to check if it matches the deleted manifest (i.e. to see
if uses the same sha256 digest). So, the more tags in repository, the worse the
performance will be (as there will be more s3 API calls occurring for the tag
directory lookups and tag file reads).

Therefore, we can use concurrent lookup and untag to optimize performance as described in https://github.com/goharbor/harbor/issues/12948.

P.S. This optimization was originally contributed by @Antiarchitect, now I would like to take it over.
Thanks @Antiarchitect's efforts with PR https://github.com/distribution/distribution/pull/3890.

Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
2024-04-26 22:32:21 +08:00
..
api_test.go Do not write manifests on HEAD requests 2024-02-29 11:16:11 +11:00
app.go add concurrency limits for tag lookup and untag 2024-04-26 22:32:21 +08:00
app_test.go Move context package internal 2023-10-27 10:58:37 -04:00
basicauth.go remove go build directive for older go version 2023-09-26 15:14:57 +08:00
blob.go Move context package internal 2023-10-27 10:58:37 -04:00
blobupload.go Move context package internal 2023-10-27 10:58:37 -04:00
catalog.go registry/api: move all errors to "errcode" package 2023-09-04 18:02:54 +02:00
context.go registry: unexport auth-related context utilities 2023-10-27 10:58:37 -04:00
health_test.go health: plumb contexts into health checks 2023-11-27 15:38:34 -05:00
helpers.go Move context package internal 2023-10-27 10:58:37 -04:00
hmac.go handlers: provide better log message on mismatched secret 2016-09-02 15:24:35 -07:00
hmac_test.go registry/handlers: use consistent names for test-tables 2023-05-09 14:00:17 +02:00
hooks.go replace strings.Split(N) for strings.Cut() or alternatives 2022-11-10 22:38:12 +01:00
mail.go Fix gometalint errors 2019-02-04 16:01:04 -08:00
manifests.go add concurrency limits for tag lookup and untag 2024-04-26 22:32:21 +08:00
tags.go Do not close HTTP request body in HTTP handler 2023-09-22 16:21:54 +01:00