Skip to content

Support target snapshot references on prepare - #3793

Merged
AkihiroSuda merged 2 commits into
containerd:masterfrom
dmcgowan:prepare-snapshot-target
Nov 26, 2019
Merged

AkihiroSuda merged 2 commits into
containerd:masterfrom
dmcgowan:prepare-snapshot-target

Conversation

@dmcgowan

@dmcgowan dmcgowan commented Nov 1, 2019

Copy link
Copy Markdown
Member

Allows backend snapshots to bring existing snapshots into a namespace without requiring clients to fully snapshots when the target reference is known. Backend snapshots must explicitly implement this functionality, it is equivalent to sharing across namespaces and is up to the backend to use the label when it is given or ignore it.

This enables remote snapshot functionality for a backend to query for a target snapshot before a client has performed any work to create that snapshot.

Further documentation is needed. I will likely create a documented related to remote snapshotters when the remainder of the work is done for those. Additionally, the behavior of snapshotters in regards to errors (and these labels) should be more fully defined in the snapshot interface definition.

There is a change here to change the behavior of the snapshot filter used by walk. Since there is no "not exists" filter for parent, it does not make sense to ever have a parent not exist from the perspective of the filter. This allows snapshots to be filtered for with parent or without parents by parent!="" or parent=="", previously parent=="" would have failed to match.

@theopenlab-ci

theopenlab-ci Bot commented Nov 1, 2019

Copy link
Copy Markdown

Build succeeded.

@codecov-io

codecov-io commented Nov 1, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #3793 into master will increase coverage by 0.06%.
The diff coverage is 52.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3793      +/-   ##
==========================================
+ Coverage   42.27%   42.34%   +0.06%     
==========================================
  Files         130      130              
  Lines       14577    14683     +106     
==========================================
+ Hits         6162     6217      +55     
- Misses       7501     7540      +39     
- Partials      914      926      +12
Flag Coverage Δ
#linux 45.76% <58.03%> (+0.02%) ⬆️
#windows 37.82% <48.02%> (+0.53%) ⬆️
Impacted Files Coverage Δ
snapshots/storage/bolt.go 55.99% <0%> (+0.24%) ⬆️
metadata/adaptors.go 48.57% <100%> (-0.97%) ⬇️
metadata/snapshot.go 48.47% <52.66%> (+0.63%) ⬆️

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 383f4a7...526c0db. Read the comment docs.

@ktock ktock left 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.

Thanks a lot for your work!

Comment thread metadata/snapshot.go Resolved
Comment thread metadata/snapshot.go Resolved
Comment thread metadata/snapshot.go Resolved
@dmcgowan
dmcgowan force-pushed the prepare-snapshot-target branch from d93bf50 to d3b384c Compare November 4, 2019 21:36
@theopenlab-ci

theopenlab-ci Bot commented Nov 4, 2019

Copy link
Copy Markdown

Build succeeded.

  • containerd-build-arm64 : RETRY_LIMIT in 24m 07s (non-voting)

@dmcgowan
dmcgowan force-pushed the prepare-snapshot-target branch from d3b384c to df4e1c7 Compare November 5, 2019 18:50
@theopenlab-ci

theopenlab-ci Bot commented Nov 5, 2019

Copy link
Copy Markdown

Build succeeded.

@mxpv mxpv left 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.

LGTM

@estesp estesp left 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.

Finished review; looks good but I found two minor typos that would be nice to fix for clarity of an error message and a comment.

Comment thread metadata/snapshot.go Outdated

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.

minor typo, but could be confusing when searching for errors: s/snaphost/snapshot/

Comment thread metadata/snapshot.go Outdated

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.

for clarity remove the word is so that it reads a prefix of ".." or "..".

@ktock

ktock commented Nov 17, 2019

Copy link
Copy Markdown
Member

@dmcgowan Any updates on this PR:smile:?
remote-snapshotter's side is ready to compliant with this protocol!

Comment thread metadata/snapshot.go Resolved
Comment thread metadata/snapshot.go Resolved
The parent property may be empty but always exists.

Signed-off-by: Derek McGowan <[email protected]>
Allows backend snapshots to bring existing snapshots into
a namespace without requiring clients to fully snapshots
when the target reference is known. Backend snapshots must
explicitly implement this functionality, it is equivalent
to sharing across namespaces and is up to the backend to
use the label when it is given or ignore it.

This enables remote snapshot functionality for a backend to
query for a target snapshot before a client has performed
any work to create that snapshot.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan
dmcgowan force-pushed the prepare-snapshot-target branch from df4e1c7 to 526c0db Compare November 25, 2019 18:08
@dmcgowan

Copy link
Copy Markdown
Member Author

Updated

@theopenlab-ci

theopenlab-ci Bot commented Nov 25, 2019

Copy link
Copy Markdown

Build succeeded.

@ktock ktock left 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.

Thanks a lot for your work!

@fuweid fuweid left 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.

LGTM

@AkihiroSuda
AkihiroSuda merged commit 45fb5ae into containerd:master Nov 26, 2019
@dmcgowan
dmcgowan deleted the prepare-snapshot-target branch March 23, 2022 22:21
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.

7 participants