Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: gc clear blobs unexpeted #174

Closed
Desiki-high opened this issue Aug 21, 2023 · 0 comments · Fixed by #175
Closed

bug: gc clear blobs unexpeted #174

Desiki-high opened this issue Aug 21, 2023 · 0 comments · Fixed by #175

Comments

@Desiki-high
Copy link
Collaborator

Desiki-high commented Aug 21, 2023

Background

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

  1. boot acceld.
  2. prepare images.
  3. 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).

Desiki-high added a commit to Desiki-high/acceleration-service that referenced this issue Aug 23, 2023
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).
To solve this problem, now gc will wait all converting tasks completed.

fix goharbor#174

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
Desiki-high added a commit to Desiki-high/acceleration-service that referenced this issue Aug 23, 2023
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).
To solve this problem, now gc will wait all converting tasks completed.

fix goharbor#174

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
Desiki-high added a commit to Desiki-high/acceleration-service that referenced this issue Aug 24, 2023
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).
To solve this problem, now gc will wait all converting tasks completed.

fix goharbor#174

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant