mirror of
https://github.com/project-zot/zot.git
synced 2026-06-19 14:08:01 +08:00
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:
committed by
GitHub
parent
55b68228da
commit
10dcd182f6
@@ -90,6 +90,12 @@ func (registry *DestinationRegistry) GetImageReference(repo, reference string) (
|
||||
func (registry *DestinationRegistry) CommitAll(repo string, imageReference ref.Ref) error {
|
||||
tempImageStore := getImageStoreFromImageReference(repo, imageReference, registry.log)
|
||||
|
||||
if tempImageStore == nil {
|
||||
registry.log.Error().Str("repo", repo).Msg("failed to get temp image store for sync commit")
|
||||
|
||||
return zerr.ErrLocalImgStoreNotFound
|
||||
}
|
||||
|
||||
defer os.RemoveAll(tempImageStore.RootDir())
|
||||
|
||||
repoDir := path.Join(tempImageStore.RootDir(), repo)
|
||||
|
||||
@@ -1720,7 +1720,16 @@ func TestDockerImagesAreSkipped(t *testing.T) {
|
||||
|
||||
// trigger config blob upstream error
|
||||
// remove synced image
|
||||
err = os.RemoveAll(path.Join(destDir, indexRepoName))
|
||||
dstRepoPath := path.Join(destDir, indexRepoName)
|
||||
for range 5 {
|
||||
err = os.RemoveAll(dstRepoPath)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
configBlobPath := path.Join(srcDir, indexRepoName, "blobs/sha256", configBlobDigest.Encoded())
|
||||
|
||||
Reference in New Issue
Block a user