Skip to content

devmapper: Fail to start container if xfs_nospace_max_retries can't be enforced - #26378

Merged
cpuguy83 merged 1 commit into
moby:masterfrom
rhvgoyal:fix-max-retries
Sep 7, 2016
Merged

cpuguy83 merged 1 commit into
moby:masterfrom
rhvgoyal:fix-max-retries

Conversation

@rhvgoyal

@rhvgoyal rhvgoyal commented Sep 7, 2016

Copy link
Copy Markdown
Contributor

We just introduced a new tunable dm.xfs_nospace_max_retries. But this tunable
will work only on new kernels where xfs supports this feature. On older
kernels xfs does not allow tuning this behavior.

There are two issues. First one is that if xfsSetNospaceRetries() fails,
it returns error but leaves the device activated and mounted. We should
be unmounting the device and deactivate it before returning.

Second issue is, if docker is started on older kernel, with
dm.xfs_nospace_max_retries specified, then docker will silently ignore the
fact that /sys file to tweak this behavior is not present and will continue.
But I think it might be better to fail initialization of graphdriver and
docker if user specified storage option can not take effect.

This patch fixes it. After this patch, user will get an error like following
when container is run (if daemon is started with option
dm.xfs_nospace_max_retries)

docker run -ti fedora bash

docker: Error response from daemon: devmapper: Failed to open file /sys/fs/xfs/dm-5/error/metadata/ENOSPC/max_retries:open /sys/fs/xfs/dm-5/error/metadata/ENOSPC/max_retries: no such file or directory.

Signed-off-by: Vivek Goyal [email protected]

@rhvgoyal

rhvgoyal commented Sep 7, 2016

Copy link
Copy Markdown
Contributor Author

@crosbymichael @runcom PTAL.

@rhvgoyal rhvgoyal changed the title devmapper: Fail to start docker if xfs_nospace_max_retries can't be enforced devmapper: Fail to start container if xfs_nospace_max_retries can't be enforced Sep 7, 2016
@crosbymichael

Copy link
Copy Markdown
Contributor

@rhvgoyal can you change the error message to help the user know what they did wrong?

Maybe something to the effect of You specified dm.xfs_nospace_max_retries but it does not seem to be supported on your system: No such file or directory

@rhvgoyal

rhvgoyal commented Sep 7, 2016

Copy link
Copy Markdown
Contributor Author

@crosbymichael Sure, will do.

…e enforced

We just introduced a new tunable dm.xfs_nospace_max_retries. But this tunable
will work only on new kernels where xfs supports this feature. On older
kernels xfs does not allow tuning this behavior.

There are two issues. First one is that if xfsSetNospaceRetries() fails,
it returns error but leaves the device activated and mounted. We should
be unmounting the device and deactivate it before returning.
 
Second issue is, if docker is started on older kernel, with
dm.xfs_nospace_max_retries specified, then docker will silently ignore the
fact that /sys file to tweak this behavior is not present and will continue.
But I think it might be better to fail container creation/start if kernel
does not support this feature.

This patch fixes it. After this patch, user will get an error like following
when container is run.

# docker run -ti fedora bash
docker: Error response from daemon: devmapper: user specified daemon option dm.xfs_nospace_max_retries but it does not seem to be supported on this system :open /sys/fs/xfs/dm-5/error/metadata/ENOSPC/max_retries: no such file or directory.

Signed-off-by: Vivek Goyal <[email protected]>
@rhvgoyal

rhvgoyal commented Sep 7, 2016

Copy link
Copy Markdown
Contributor Author

@crosbymichael PTAL

@crosbymichael

Copy link
Copy Markdown
Contributor

LGTM

@runcom

runcom commented Sep 7, 2016

Copy link
Copy Markdown
Member

LGTM (pending tests)

@cpuguy83
cpuguy83 merged commit ce5eb34 into moby:master Sep 7, 2016
@thaJeztah thaJeztah added this to the 1.13.0 milestone Sep 26, 2016
@thaJeztah

Copy link
Copy Markdown
Member

relates to #26212

@runcom

runcom commented Sep 26, 2016

Copy link
Copy Markdown
Member

@rhvgoyal is this (or #26212) fixing any issue present in 1.12.1? or is this just for master (upcoming 1.13)

@rhvgoyal

Copy link
Copy Markdown
Contributor Author

@runcom, this fix is for 1.13

liusdu pushed a commit to liusdu/moby that referenced this pull request Oct 30, 2017
…e enforced

We just introduced a new tunable dm.xfs_nospace_max_retries. But this tunable
will work only on new kernels where xfs supports this feature. On older
kernels xfs does not allow tuning this behavior.

There are two issues. First one is that if xfsSetNospaceRetries() fails,
it returns error but leaves the device activated and mounted. We should
be unmounting the device and deactivate it before returning.

Second issue is, if docker is started on older kernel, with
dm.xfs_nospace_max_retries specified, then docker will silently ignore the
fact that /sys file to tweak this behavior is not present and will continue.
But I think it might be better to fail container creation/start if kernel
does not support this feature.

This patch fixes it. After this patch, user will get an error like following
when container is run.

docker: Error response from daemon: devmapper: user specified daemon option dm.xfs_nospace_max_retries but it does not seem to be supported on this system :open /sys/fs/xfs/dm-5/error/metadata/ENOSPC/max_retries: no such file or directory.

Signed-off-by: Vivek Goyal <[email protected]>
Signed-off-by: Wentao Zhang <[email protected]>
cherry picked from moby#26378
liusdu pushed a commit to liusdu/moby that referenced this pull request Oct 30, 2017
Cherry pick devmapper relative commits from master branch

Merge 5 commits:

<a href="/docker/docker/commit/4f0017b9ad7dfa2e9dcdee69d000b98595893e60" data-original="4f0017b9" data-project="7713" data-commit="4f0017b9ad7dfa2e9dcdee69d000b98595893e60" data-reference-type="commit" title="Commit: Vivek Goyal - devmapper: Provide a knob dm.xfs_nospace_max_retries" class="gfm gfm-commit">4f0017b9</a>     <a href="moby#26212" rel="nofollow noreferrer" target="_blank">https://github.com/docker/docker/pull/26212</a><br>
<a href="/docker/docker/commit/55a9b8123d7e89692b5c25c846cf6707a8ce463a" data-original="55a9b812" data-project="7713" data-commit="55a9b8123d7e89692b5c25c846cf6707a8ce463a" data-reference-type="commit" title="Commit: Vivek Goyal - Export Mininum Thin Pool Free Space through docker info" class="gfm gfm-commit">55a9b812</a>     <a href="moby#21945" rel="nofollow noreferrer" target="_blank">https://github.com/docker/docker/pull/21945</a><br>
288f933     <a href="moby#28500" rel="nofollow noreferrer" target="_blank">https://github.com/docker/docker/pull/28500</a><br>
 


d4a2bcc  moby#23974

6cc55dd  moby#26378  
41c6083   moby#26918  






Signed-off-by: Wentao Zhang <a href="mailto:[email protected]">[email protected]</a>


See merge request docker/docker!281
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.

6 participants