refactor(storage): add a common blobstore to store all blobs (#4136)

* feat(storage): add a common blobstore to store all blobs (#3906)

Currently, zot uses one of the existing repos as the master copy for a blob to
achieve dedupe, which complicates dedupe tracking logic. Furthermore, we
have a global storage lock which is becoming a bottleneck. In order to
move to a per-repo lock, we first need to simplify this logic.

Now use a single hidden global repo (_blobstore/) as a blob store instead.

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(storage): address blobstore cache correctness issues

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
Ramkumar Chinchani
2026-06-16 15:30:37 -07:00
committed by GitHub
parent 55b68228da
commit 10dcd182f6
21 changed files with 1219 additions and 445 deletions
+8 -4
View File
@@ -177,7 +177,7 @@ function teardown_file() {
# sync image
@test "sync docker image list on demand" {
zot_port=`cat ${BATS_FILE_TMPDIR}/zot.port`
run skopeo --insecure-policy copy --multi-arch=all --src-tls-verify=false \
run skopeo --insecure-policy copy --all --src-tls-verify=false \
docker://127.0.0.1:${zot_port}/registry \
oci:${TEST_DATA_DIR}
[ "$status" -eq 0 ]
@@ -190,7 +190,7 @@ function teardown_file() {
[ $(echo "${lines[-1]}" | jq '.tags[]') = '"latest"' ]
# make sure image is skipped when synced again
run skopeo --insecure-policy copy --multi-arch=all --src-tls-verify=false \
run skopeo --insecure-policy copy --all --src-tls-verify=false \
docker://127.0.0.1:${zot_port}/registry \
oci:${TEST_DATA_DIR}
[ "$status" -eq 0 ]
@@ -225,7 +225,7 @@ function teardown_file() {
@test "sync k8s image list on demand" {
zot_port=`cat ${BATS_FILE_TMPDIR}/zot.port`
run skopeo --insecure-policy copy --multi-arch=all --src-tls-verify=false \
run skopeo --insecure-policy copy --all --src-tls-verify=false \
docker://127.0.0.1:${zot_port}/kube-apiserver:v1.26.0 \
oci:${TEST_DATA_DIR}
[ "$status" -eq 0 ]
@@ -347,7 +347,11 @@ function teardown_file() {
@test "run docker with image synced from docker.io" {
zot_port=`cat ${BATS_FILE_TMPDIR}/zot.port`
local zot_root_dir=${BATS_FILE_TMPDIR}/zot
run rm -rf ${zot_root_dir}
# Remove only the archlinux repo dir (not the entire root) so that _blobstore
# remains intact while the server is still running. Wiping the full root causes
# DedupeBlob to repeatedly fail to stat blobs in _blobstore, resulting in an
# infinite retry loop.
run rm -rf ${zot_root_dir}/archlinux
[ "$status" -eq 0 ]
run docker run -d 127.0.0.1:${zot_port}/archlinux:latest