Skip to content

Carry #35333: Devicemapper: ignore Nodata errors when delete thin device#35919

Merged
thaJeztah merged 2 commits into
moby:masterfrom
yongtang:35333-carry
Jan 20, 2018
Merged

Carry #35333: Devicemapper: ignore Nodata errors when delete thin device#35919
thaJeztah merged 2 commits into
moby:masterfrom
yongtang:35333-carry

Conversation

@yongtang
Copy link
Copy Markdown
Member

@yongtang yongtang commented Jan 3, 2018

- What I did

This fix carries #35333 and adds the needed test to cover the changes.

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

This fix fixes #34463. This fix closes #35333.

if thin device is deteled and the metadata exists, you can not
delete related containers. This patch ignore Nodata errors for
thin device deletion

Signed-off-by: Liu Hua <[email protected]>
…te thin device

This fix adds a test case for 35333: Devicemapper: ignore Nodata errors when delete thin device

Signed-off-by: Yong Tang <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member

Thanks @yongtang!

ping @kolyshkin @vieux

dmSawBusy bool
dmSawExist bool
dmSawEnxio bool // No Such Device or Address
dmSawEnoData bool // No data available
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.

Could these be returned from task.run() instead of globals?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

ok, yes that does seem like it would require a much bigger change to fix.

client := request.NewAPIClient(t)
ctx := context.Background()

foo, err := client.ContainerCreate(ctx,
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.

Does this change actually need a container to exist, or could this be a unit test in pkg/devicemapper ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@dnephin The PR tries to fix the issue where an out-of-sync deletion of pool device will not prevent container deletion from returning an error. Though I am not very familiar with this part of the code. There is no existing unit test in pkg/devicemapper so not sure if it is possible to created a unit test easily.

@kolyshkin
Copy link
Copy Markdown
Contributor

As I said in #35333

Looks a bit kludgy, but I can't think of anything better, therefore LGTM

LGTM

Copy link
Copy Markdown
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🌮

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit db5c006 into moby:master Jan 20, 2018
@yongtang yongtang deleted the 35333-carry branch January 21, 2018 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error response from daemon: devicemapper failed to remove the rootFS for <id> : devicemapper : Error running DeleteDevice dm_task_run failed

8 participants