Skip to content

devmapper: activate dm device if snap device marked as activated#3567

Merged
crosbymichael merged 1 commit intocontainerd:masterfrom
renzhengeek:renzhen/devmapper
Aug 30, 2019
Merged

devmapper: activate dm device if snap device marked as activated#3567
crosbymichael merged 1 commit intocontainerd:masterfrom
renzhengeek:renzhen/devmapper

Conversation

@renzhengeek
Copy link
Copy Markdown

  • reproducer
  1. stop a container;
  2. reboot, or dmsetup remove its corresponding dm device;
  3. start the container, it will fail like:

"""
Error: failed to start containers: {"message":"failed to create container(4f33d2760760c41518a84821153ccdf7f80980b797b783cdd75178fc6ca0bf4b) on containerd: failed to create task for container(4f33d2760760c41518a84821153ccdf7f80980b797b783cdd75178fc6ca0bf4b): failed to mount rootfs component &{ext4 /dev/mapper/vg0-mythinpool-snap-2 []}: no such file or directory: unknown"}
"""

  • how the fix works
    activate the dm device if necessary, and give a warn msg:

"""
time="2019-08-21T22:44:08.422695797+08:00" level=warning msg="devmapper device "vg0-mythinpool-snap-2" marked as "Activated" but not active, activating it"
"""

Signed-off-by: Eric Ren [email protected]

@renzhengeek
Copy link
Copy Markdown
Author

Hi, @mxpv @fuweid @Ace-Tang please help review~

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Aug 21, 2019

Build succeeded.

Comment thread snapshots/devmapper/pool_device.go Outdated
Comment thread snapshots/devmapper/pool_device_test.go Outdated
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Aug 22, 2019

Build succeeded.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Aug 22, 2019

Codecov Report

Merging #3567 into master will decrease coverage by 0.01%.
The diff coverage is 47.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3567      +/-   ##
==========================================
- Coverage   42.26%   42.25%   -0.02%     
==========================================
  Files         126      126              
  Lines       13881    13890       +9     
==========================================
+ Hits         5867     5869       +2     
- Misses       7128     7135       +7     
  Partials      886      886
Flag Coverage Δ
#linux 45.73% <47.05%> (-0.02%) ⬇️
#windows 37.23% <ø> (ø) ⬆️
Impacted Files Coverage Δ
snapshots/devmapper/pool_device.go 55.6% <47.05%> (-1.35%) ⬇️

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 80ed8e1...4d11bb3. Read the comment docs.

Copy link
Copy Markdown
Member

@mxpv mxpv left a comment

Choose a reason for hiding this comment

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

One minor suggestion, otherwise LGTM.

Comment thread snapshots/devmapper/pool_device.go Outdated
- reproducer
 1. stop a container;
 2. reboot, or dmsetup remove its corresponding dm device;
 3. start the container, it will fail like:

 """
 Error: failed to start containers: {"message":"failed to create container(4f33d2760760c41518a84821153ccdf7f80980b797b783cdd75178fc6ca0bf4b) on containerd: failed to create task for container(4f33d2760760c41518a84821153ccdf7f80980b797b783cdd75178fc6ca0bf4b): failed to mount rootfs component &{ext4 /dev/mapper/vg0-mythinpool-snap-2 []}: no such file or directory: unknown"}
 """
- how the fix works
 activate the dm device if necessary, and give a warn msg:

 """
 time="2019-08-21T22:44:08.422695797+08:00" level=warning msg="devmapper device \"vg0-mythinpool-snap-2\" marked as \"Activated\" but not active, activating it"
 """

Signed-off-by: Eric Ren <[email protected]>
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Aug 23, 2019

Build succeeded.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

@crosbymichael crosbymichael merged commit 95301fe into containerd:master Aug 30, 2019
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