Skip to content

Garbage collection and blobdescriptor cache do not coordinate blob cleanup #5010

Open

Description

@jsingleton785

Description

Periodically, the garbage collection will cleanup up an image without communicating with the blobdescriptor cache, resulting in the image being "pulled" but returning 0 bytes to the requestor.

This generates the following error:

Image

Reproduce

Reproduction is difficult and variable. This error only happens on some of our most pulled images connected to a cluster that pulls images very frequently.

The configuration has the blobdescriptor cache set to inmemory.

Reproduction involves the following:

  1. Restart the container/pod
  2. Connect a high volume pull client
  3. Wait 1-2 days for the garbage collection to delete a pod that is still in the blobdescriptor cache
  4. Attempt to pull image and receive an error detailing how many bytes were expected but get 0 bytes.

The error only appears on a cluster using the pods as a pull through cache that frequently pulls a myriad of images.

Expected behavior

If the blob doesn't exist in the backend storage, one of two things happens:

  1. (Preferred) Registry pulls image from the source, and refreshes the blobs in the backend storage.
  2. The registry returns a 404 or another error.

registry version

3.1.2

Additional Info

The pod appears to attempt to pull from the backend storage a blob that doesn't exist. Rathering that throwing a 404 or another error, it returns a 200 with 0 bytes and the client experiences the error.

This may be related to #4939 and was thought to be fixed by #4868

A temporary workaround is to disable the blobdescriptor cache by setting the field to an empty string. This could feasibly increase latency with pulls, but prevents the mismatch between blobdescriptor cache and the backend storage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions