distribution/registry/storage
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
..
cache chore: fix some typos in comments 2024-04-23 12:04:03 +08:00
driver Allow setting s3 forcepathstyle without regionendpoint (#4291) 2024-04-24 08:34:01 +01:00
blob_test.go chore: fix some typos in comments 2024-04-23 12:04:03 +08:00
blobserver.go storage/driver: replace URLFor method 2023-10-27 10:58:37 -04:00
blobstore.go Move context package internal 2023-10-27 10:58:37 -04:00
blobwriter.go chore: remove repetitive words in comments 2024-03-27 17:34:22 +08:00
blobwriter_nonresumable.go Move context package internal 2023-10-27 10:58:37 -04:00
blobwriter_resumable.go format code with gofumpt 2022-11-03 22:48:20 +01:00
catalog.go Merge pull request #4031 from thaJeztah/migrate_reference 2023-08-31 15:20:28 +01:00
catalog_test.go Merge pull request #4031 from thaJeztah/migrate_reference 2023-08-31 15:20:28 +01:00
doc.go Move storage package under registry package 2015-02-11 12:43:04 -08:00
error.go Remove old walk function 2018-01-18 13:06:07 -08:00
filereader.go cleanup: make blob sizes easier to understand 2023-10-31 14:53:02 -07:00
filereader_test.go feat(linter): enable errcheck linter in golangci-lint 2023-11-18 07:19:24 +00:00
garbagecollect.go fix: ignore error of manifest tag path not found in gc 2024-04-25 17:13:06 +08:00
garbagecollect_test.go fix: ignore error of manifest tag path not found in gc 2024-04-25 17:13:06 +08:00
io.go cleanup: make blob sizes easier to understand 2023-10-31 14:53:02 -07:00
linkedblobstore.go Move context package internal 2023-10-27 10:58:37 -04:00
linkedblobstore_test.go deprecate reference package, migrate to github.com/distribution/reference 2023-08-31 15:47:06 +02:00
manifestlisthandler.go Move context package internal 2023-10-27 10:58:37 -04:00
manifeststore.go Move context package internal 2023-10-27 10:58:37 -04:00
manifeststore_test.go feat(linter): enable errcheck linter in golangci-lint 2023-11-18 07:19:24 +00:00
ociindexhandler.go Move context package internal 2023-10-27 10:58:37 -04:00
ocimanifesthandler.go Move context package internal 2023-10-27 10:58:37 -04:00
ocimanifesthandler_test.go registry: verify digest and check blob presence when put manifest 2021-04-16 16:11:52 +08:00
paths.go add repositoriesRootPathSpec in pathFor documentation 2023-09-26 15:07:49 +08:00
paths_test.go format code with gofumpt 2022-11-03 22:48:20 +01:00
purgeuploads.go Switch to github.com/google/uuid 2023-10-25 12:15:21 +01:00
purgeuploads_test.go feat(linter): enable errcheck linter in golangci-lint 2023-11-18 07:19:24 +00:00
registry.go add concurrency limits for tag lookup and untag 2024-04-26 22:32:21 +08:00
schema2manifesthandler.go Move context package internal 2023-10-27 10:58:37 -04:00
schema2manifesthandler_test.go Move context package internal 2023-10-27 10:58:37 -04:00
tagstore.go add concurrency limits for tag lookup and untag 2024-04-26 22:32:21 +08:00
tagstore_test.go deprecate reference package, migrate to github.com/distribution/reference 2023-08-31 15:47:06 +02:00
vacuum.go Move context package internal 2023-10-27 10:58:37 -04:00