Gc will clear blobs by lease manager, lease manager will clear lease by lease cache. Lease will be updated in commit and read of each blob.
When acceld work in multithread conversion with different jobs, some task can not find the blob locally.
time="2023-08-21T06:18:38.55829375Z" level=warning msg="failed to set containerd.io/uncompressed label for sha256:52d2b7f179e32b4cbd579ee3c4958027988f9a8274850ab0c7c24661e3adaac5" error="content digest sha256:52d2b7f179e32b4cbd579ee3c4958027988f9a8274850ab0c7c24661e3adaac5: not found"
time="2023-08-21T06:18:38.55838805Z" level=error msg="convert in worker: convert image: content digest sha256:fd9f026c631046113bd492f69761c3ba6042c791c35a60e7c7f3b8f254592daa: not found"
Reproduce
boot acceld.
prepare images.
use accelctl create different tasks.
images=("nginx" "alpine" "busybox")
for image in ${images[@]}; do
./accelctl task create localhost/library/$image:latest
done
Reason
When acceld converts multiple images with large size differences, for example : alpine and WordPress. Obviously alpine will finish the task first, and WordPress is still in the pulling phase. If alpine triggers gc(decide by configuration), GC will clear the blobs of WordPress because the lease of WordPress blob had cached in lease and only used once(in commit).
Background
Gc will clear blobs by lease manager, lease manager will clear lease by lease cache. Lease will be updated in
commit
andread
of each blob. Whenacceld
work in multithread conversion with different jobs, some task can not find the blob locally.Reproduce
acceld
.accelctl
create different tasks.Reason
When acceld converts multiple images with large size differences, for example :
alpine
andWordPress
. Obviouslyalpine
will finish the task first, andWordPress
is still in the pulling phase. Ifalpine
triggers gc(decide by configuration), GC will clear the blobs ofWordPress
because the lease ofWordPress
blob had cached in lease and only used once(in commit).