Skip to content

Add support for back references in the garbage collector#12025

Merged
AkihiroSuda merged 4 commits intocontainerd:mainfrom
dmcgowan:gc-reverse-ref
Aug 22, 2025
Merged

Add support for back references in the garbage collector#12025
AkihiroSuda merged 4 commits intocontainerd:mainfrom
dmcgowan:gc-reverse-ref

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

Add backreference labels for an object. This allows objects to be referred to by objects which already exist without updating the labels on the original object or referred to by objects which do not yet exist. This is useful for ephemeral objects as well as objects with a 1 to many relationship.

Use cases:

  • Dependent images ("dangling" images)
  • Ephemeral container objects (such as streams, networks, or mounts)
  • OCI referrers (1 to many relationship)

dmcgowan added 3 commits June 24, 2025 13:15
Allows an object to create a backreference, allowing objects to be
referred to by objects which already exist without updating the labels
on the original object. This is useful for ephemeral objects as well as
objects with a 1 to many relationship or created after another object.

Signed-off-by: Derek McGowan <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan added this to the 2.2 milestone Jul 7, 2025
@dmcgowan dmcgowan mentioned this pull request Jul 7, 2025
Comment thread core/metadata/gc_test.go
}
return dgstr.Digest()
d := dgstr.Digest()
return digest.NewDigestFromEncoded(d.Algorithm(), fmt.Sprintf("%03d00", i)+d.Encoded()[5:])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to need a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a test so I think this is just for easy debugging as the i is usually a small integer in the tests, so digests always start 00i00 so it is easy to spot in log output for debugging?

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Aug 22, 2025
@AkihiroSuda AkihiroSuda added this pull request to the merge queue Aug 22, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 22, 2025
@AkihiroSuda AkihiroSuda added this pull request to the merge queue Aug 22, 2025
Merged via the queue into containerd:main with commit 1321cbc Aug 22, 2025
124 of 128 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Aug 22, 2025
@dmcgowan dmcgowan added impact/changelog area/storage Image Storage and removed area/storage Image Storage labels Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants