Skip to content

Improved lease management#2474

Merged
crosbymichael merged 5 commits intocontainerd:masterfrom
dmcgowan:lease-expiration
Jul 20, 2018
Merged

Improved lease management#2474
crosbymichael merged 5 commits intocontainerd:masterfrom
dmcgowan:lease-expiration

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

@dmcgowan dmcgowan commented Jul 18, 2018

Currently leases are not tracked very easily. If a client crashes or loses reference to a lease there is currently no good way to see those leases and clean them up. This change provides a better interface for managing those leases and updates the default lease behavior from client to expire after 24 hours.

A few different changes here that seemed to make sense to come together...

  • Add expiration label and support in the garbage collector
  • Update client to set a default expiration of 24 hours
  • Add manager interface creating, listing, and removing snapshots, use on client and service
  • Support for lease filters
  • ctr leases subcommand for creating, listing, and removing leases

A few more follow ups to come for this

  • Upstream cri plugin change
  • Synchronous garbage collection flag on lease deletion
  • Content uploads integrated with leases and GC

closes #2093

Allow setting an expiration label to have the garbage
collector remove an item after the specified time.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan added this to the 1.2 milestone Jul 18, 2018
@stevvooe
Copy link
Copy Markdown
Member

LGTM

I feel like using a label for lease expiry is a little weird. Can we change that in a backwards compatible way or is that even worth it?

dmcgowan added 4 commits July 18, 2018 10:43
Add leases manager to the leases package and use the
interface on the client and service.

Signed-off-by: Derek McGowan <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2474 into master will increase coverage by 0.04%.
The diff coverage is 57.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2474      +/-   ##
=========================================
+ Coverage   44.76%   44.8%   +0.04%     
=========================================
  Files          92      92              
  Lines        9483    9534      +51     
=========================================
+ Hits         4245    4272      +27     
- Misses       4555    4572      +17     
- Partials      683     690       +7
Flag Coverage Δ
#linux 49.03% <60.29%> (+0.05%) ⬆️
#windows 41.11% <57.5%> (+0.07%) ⬆️
Impacted Files Coverage Δ
metadata/leases.go 40.6% <52.63%> (-2.07%) ⬇️
metadata/gc.go 62.01% <61.29%> (+0.05%) ⬆️
metadata/adaptors.go 41.46% <63.63%> (+3.43%) ⬆️

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 02579c8...29b72d4. Read the comment docs.

@dmcgowan
Copy link
Copy Markdown
Member Author

I feel like using a label for lease expiry is a little weird. Can we change that in a backwards compatible way or is that even worth it?

It is consistent with our other option GC related flags. We can always move labels to first class fields in the future if we see value in it, I don't right now. I mostly want to avoid API changes here, although I will probably add another one for sync delete anyway.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

@crosbymichael crosbymichael merged commit 0d52c71 into containerd:master Jul 20, 2018
@dmcgowan dmcgowan deleted the lease-expiration branch September 10, 2019 17:47
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.

lease expiration label

4 participants