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>
This commit is contained in:
Ramkumar Chinchani
2026-06-09 12:13:44 -07:00
committed by GitHub
parent 273b15364b
commit 936a60d4f7
21 changed files with 1111 additions and 437 deletions
+31 -1
View File
@@ -655,14 +655,26 @@ func TestObjectStorageController(t *testing.T) {
endpoint := os.Getenv("S3MOCK_ENDPOINT")
tmp := t.TempDir()
// create s3 bucket
resp, err := resty.R().Put("http://" + endpoint + "/" + bucket)
if err != nil {
panic(err)
}
if resp.StatusCode() != http.StatusOK {
panic(fmt.Sprintf("failed to create bucket: %d %s", resp.StatusCode(), resp.String()))
}
storageDriverParams := map[string]any{
"rootdirectory": tmp,
"name": storageConstants.S3StorageDriverName,
"region": "us-east-2",
"bucket": bucket,
"regionendpoint": endpoint,
"accesskey": "minioadmin",
"secretkey": "minioadmin",
"secure": false,
"skipverify": false,
"forcepathstyle": true,
}
conf.Storage.StorageDriver = storageDriverParams
@@ -688,8 +700,11 @@ func TestObjectStorageController(t *testing.T) {
"region": "us-east-2",
"bucket": bucket,
"regionendpoint": endpoint,
"accesskey": "minioadmin",
"secretkey": "minioadmin",
"secure": false,
"skipverify": false,
"forcepathstyle": true,
}
conf.Storage.RemoteCache = true
conf.Storage.StorageDriver = storageDriverParams
@@ -736,10 +751,13 @@ func TestObjectStorageController(t *testing.T) {
}
// create s3 bucket
_, err = resty.R().Put("http://" + os.Getenv("S3MOCK_ENDPOINT") + "/" + bucket)
resp, err := resty.R().Put("http://" + os.Getenv("S3MOCK_ENDPOINT") + "/" + bucket)
if err != nil {
panic(err)
}
if resp.StatusCode() != http.StatusOK {
panic(fmt.Sprintf("failed to create bucket: %d %s", resp.StatusCode(), resp.String()))
}
ctlr := makeController(conf, "/")
So(ctlr, ShouldNotBeNil)
@@ -764,14 +782,26 @@ func TestObjectStorageControllerSubPaths(t *testing.T) {
endpoint := os.Getenv("S3MOCK_ENDPOINT")
tmp := t.TempDir()
// create s3 bucket
resp, err := resty.R().Put("http://" + endpoint + "/" + bucket)
if err != nil {
panic(err)
}
if resp.StatusCode() != http.StatusOK {
panic(fmt.Sprintf("failed to create bucket: %d %s", resp.StatusCode(), resp.String()))
}
storageDriverParams := map[string]any{
"rootdirectory": tmp,
"name": storageConstants.S3StorageDriverName,
"region": "us-east-2",
"bucket": bucket,
"regionendpoint": endpoint,
"accesskey": "minioadmin",
"secretkey": "minioadmin",
"secure": false,
"skipverify": false,
"forcepathstyle": true,
}
conf.Storage.StorageDriver = storageDriverParams
ctlr := makeController(conf, tmp)