Skip to content

[release/1.0] metadata: image removal triggers GC#2018

Merged
estesp merged 2 commits intocontainerd:release/1.0from
dmcgowan:cherry-pick-image-removal-gc
Jan 18, 2018
Merged

[release/1.0] metadata: image removal triggers GC#2018
estesp merged 2 commits intocontainerd:release/1.0from
dmcgowan:cherry-pick-image-removal-gc

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

Backport of #1960

This includes some minor refactoring to fix the original bug. Includes more test coverage.

Directly get and check whether a bucket is empty.
This prevents unnecessarily loading all records of
the buckets into memory just to check existence.
Also added checks for content and snapshots.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan changed the base branch from master to release/1.0 January 17, 2018 23:13
The boltdb image store now manages its own transactions when
one is not provided, but allows the caller to pass in a
transaction through the context. This makes the image store
more similar to the content and snapshot stores. Additionally,
use the reference to the metadata database to mark the content
store as dirty after an image has been deleted. The deletion
of an image means a reference to a piece of content is gone
and therefore garbage collection should be run to check if
any resources can be cleaned up as a result.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan force-pushed the cherry-pick-image-removal-gc branch from 058b115 to d04746b Compare January 17, 2018 23:15
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2018 into release/1.0 will decrease coverage by <.01%.
The diff coverage is 48.71%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release/1.0    #2018      +/-   ##
===============================================
- Coverage        50.59%   50.59%   -0.01%     
===============================================
  Files               81       81              
  Lines             7137     7165      +28     
===============================================
+ Hits              3611     3625      +14     
- Misses            2835     2847      +12     
- Partials           691      693       +2
Flag Coverage Δ
#linux 50.59% <48.71%> (-0.01%) ⬇️
Impacted Files Coverage Δ
metadata/namespaces.go 0% <0%> (ø) ⬆️
metadata/buckets.go 61.53% <50%> (-0.59%) ⬇️
metadata/images.go 63.15% <66.66%> (+0.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b55aab...d04746b. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit d2179c2 into containerd:release/1.0 Jan 18, 2018
@dmcgowan dmcgowan deleted the cherry-pick-image-removal-gc branch September 10, 2019 17:46
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 this pull request may close these issues.

4 participants