libcontainerd: change the digest used when restoring#47456
libcontainerd: change the digest used when restoring#47456thaJeztah merged 1 commit intomoby:masterfrom
Conversation
For current implementation of Checkpoint Restore (C/R) in docker, it will write the checkpoint to content store. However, when restoring libcontainerd uses .Digest().Encoded(), which will remove the info of alg, leading to error. Signed-off-by: huang-jl <1046678590@qq.com>
vvoland
left a comment
There was a problem hiding this comment.
LGTM; thanks!
Looks to be a regression in v25: fd6dd69#diff-c3c703e02023ce6a127448365c946281594c6ee77acf7981fbfba77d3d97a89cR740
So no need for a v24 cherry-pick.
Oh, good catch! I bookmarked this one as I was wondering indeed if this never worked, or if we regressed, so thanks for doing the digging 😄 |
|
@huang-jl Are you interested in opening a cherry-pick for v25.0? |
|
@vvoland Of course, but I do not understand what means "cherry-pick for v25.0". Do you mean send a pull request to branch "25.0"? |
|
That's correct! Basically create a new branch based off the $ git checkout -b fix_restore_digest_25 upstream/25.0
$ git cherry-pick -x fix_restore_digest |
|
I'm still getting the original error, running on v25: root@siegfried:/home/coder# docker run --name cr1 -d busybox /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
245eb5fe28af02b9d9b0ce404d50673db886330be7fb348b9e709f93f1aa52cb
root@siegfried:/home/coder# docker checkpoint create cr1 sleepy1
sleepy1
root@siegfried:/home/coder# docker start --checkpoint sleepy1 cr1
Error response from daemon: failed to upload checkpoint to containerd: commit failed: content sha256:8fae2a5b4ca0ece5c2a72fcf8424e2a8c80b07badfd040892961f6deb1c480ef: already existsVersions: # docker version | grep -e Client -e Engine -A1
Client: Docker Engine - Community
Version: 25.0.3
--
Server: Docker Engine - Community
Engine:
Version: 25.0.3 |
|
@dannykopping I see the backport linked to this ticket was included in 25.0.4; #47466
|
|
Ah, missed that; thank you @thaJeztah |

For current implementation of Checkpoint Restore (C/R) in docker, it will write the checkpoint to content store. However, when restoring libcontainerd uses
.Digest().Encoded(), which will remove the info of algorithms, leading to a NotFound error.- What I did
For now when using C/R to start a container like:
It will failed like:
The reason is that when restoring, it query the content store with
.Digest().Encoded().- How I did it
Change it to use
.Diegest().String()- How to verify it
- Description for the changelog