-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
device-mapper udev sync #10195
device-mapper udev sync #10195
Conversation
expose an api to call dm_udev_get_sync_support/dm_udev_set_sync_support Signed-off-by: Vincent Batts <vbatts@redhat.com>
@@ -947,6 +947,12 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error { | |||
return graphdriver.ErrNotSupported | |||
} | |||
|
|||
// https://github.com/docker/docker/issues/4036 | |||
if supported := devicemapper.UdevSetSyncSupport(true); !supported { | |||
log.Warnf("Warning, Udev sync is not supported. Behavior may be unpredictable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vbatts I'd change Warning, Udev sync is not supported. Behavior may be unpredictable
to something along the lines of WARNING: Udev sync is not supported. This will lead to unexpected behavior, data loss and errors
.
Perhaps we should also print the kind of errors (like the ones seen on #4036) one would see when printing this warning? This should make it easier to set expectations, rather than letting users ignore it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about just a link to #4036?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought about that, but #4036 seems to have become a catchall for devicemapper related issues. It might end up being very confusing when trying to figure out exactly what kind of errors could be attributed to this and what could be caused by something else.
when initializing the devmapper driver, attempt to sync udev and device mapper. If udev sync is not supported, print a warning. Eventually we'll likely bail here to avoid unpredictable behavior for users. Signed-off-by: Vincent Batts <vbatts@redhat.com>
2c6fb0b
to
022e123
Compare
@unclejack I just updated the warning |
LGTM, and also interested to see this setting's value in |
@icecrime oh? well that is an idea too, and easy enough to do. Though I would not print a warning then, only in the daemon log. |
It doesn't necessarily have to be in this PR. It's just that I understand from reading the patch that udev sync really matters, so if we see issues filed for device mapper problems it would probably make sense to know the value of this setting for investigation, right? |
now: ``` [...] Storage Driver: devicemapper Pool Name: docker-253:2-5767172-pool [...] Udev Sync Supported: true [...] ``` Signed-off-by: Vincent Batts <vbatts@redhat.com>
@icecrime done. PTAL. |
Perfect thanks! LGTM |
I've tested this on CentOS 7 with dynbinary and it's all working just fine. This can be merged after the drone build is done.
LGTM |
I am looking at libdm code. dm_udev_set_sync_support() does not do anything if libdm was built without UDEV_SYNC_SUPPORT. If udev sync support was enabled, dm_udev_set_sync_support() sets IOW, if libdm is built with udev sync support, it is enabled by default. If it is not built with udev sync support then one can not enable it at run time. So calling dm_udev_set_sync_support() from docker should not help in anyway. Am I missing something? |
@rhvgoyal while |
ok, so this commit will just introduce warnings if udev_sync is not supported (when docker binary is built static) and make debugging little easier. But it should not fix udev races. So we still have the problem that how to address the issue of libdm and udev races with statically built docker. |
@rhvgoyal that is a different story. static docker, means static libdm, which would require libudev, which will not happen. 1) systemd/udev does not even allow static linking; 2) you would not want to have varying versions of udev (static in docker and whatever version on the host) because the API is not guaranteed across versions. For static docker, you either get libdm vs. udev race or should disable the device-mapper driver entirely. Which in that case, sync_support will return 0/false. Basically, we should get to the point of sanity checking for drivers, and if |
I'm not running udev at all - can I ignore this warning? |
David, interesting that your OS is not running udev. Can you provide more
|
Also, if udev is not present at all then Though in docker 1.7 you will need to add an additional flag to proceed
|
Thanks - that'll be I'm running a Linux OS I built myself: https://github.com/davedoesdev/heddle |
That's the right flag. Hopefully you'll trial the different drivers you can
|
Thanks. I also support btrfs which I'm finding to be a great filesystem. I'll probably default to btrfs soon and leave the devicemapper backend on loopfile. |
sync devicemapper and udev.
If sync is not supported, print a warning that unexpected behavior may occur.
relates to #4036
ping @unclejack