Repository navigation
Fix implicit DeviceMapper selection - #14292
Conversation
1623512 to
5f8aa57
Compare
There was a problem hiding this comment.
I'm not sure it's true in all cases: if you are on a RedHat system with a dynamically linked binary, I think it's fine having an automatic election of devicemapper.
There was a problem hiding this comment.
I changed it to fail only if the binary was statically compiled.
5f8aa57 to
4c4c7ea
Compare
There was a problem hiding this comment.
Isn't len(DefaultDriver) == 0 necessarily true in this code path? It seems that if it wasn't, we would have returned above in line 113, no? So maybe that can be simplified as if _, ok := priorDrivers["devicemapper"]; ok && dockerversion.IAMSTATIC == "true" {.
There was a problem hiding this comment.
oh, that's correct. Fixing.
f0a26c7 to
069db00
Compare
|
I am not sure what's the purpose of this patch. For dynamic binary case, a user should not have to select devicemapper explicitly. Those who are complaining about docker not starting over upgrade, that was deliberate. People have been using static binaries with devicemapper driver and it was broken. Docker 1.6 allowed it and @vbatts and others wanted users to move away from it. That's the reason in 1.7, docker will fail (instead of continuing) by default. And that's what everybody is running into. This is by design and not an error. Those who are running into issues, solution is not to downgrade to 1.6. But one of the following.
Note: IIRC, I had opposed failing by default because that would break existing users over upgrade. And that's what precisely is happening. But people had argued that we don't want people to continue to use already broken setups hence we want to break these systems over upgrade and let users opt-in for a broken system or switch to a different driver. So all this is intentional folks. |
|
@rhvgoyal The intention here is to be more clear about why docker is failing to start. This is what's going to happen with this change: 1 - Case where you're running a dynamic binary, you have the devicemapper directory and you don't select the driver: Everything is okay, we select devicemapper and move forward. So instead of asking people to set another flag Is this clear enough @icecrime? |
069db00 to
a6f3bc4
Compare
|
I added |
|
Users need to set --storage-opt dm.override_udev_sync_check=true only in two cases, when using static docker binary.
And in both the cases, it is reasonable to ask user to acknowledge that their current setup is broken and still they want to continue to use it and hence they need to opt-in using this flag. |
No, the intention is not clear, neither the behavior, and that's the main problem that people have. Requiring people to use |
|
People are forced to use it only if they had been using devicemapper previously. As docker selected it. and it is a broken configuraiton. If you are starting docker fresh, devicemapper might not be selected at all as it is so low in priority table. Even if it is selected, initialization will fail and docker will move on to overlay. So people need to specify udev sync flag, only if they decide to use devicemapper. And that's happening only in upgrade case where docker is imposing devicemapper as that's the prior used driver. |
|
IOW, docker -d --storage-opt dm.override_udev_sync_check=true is corner case. Where user has not selected a graph driver but docker is forcing devicemapper as that's the one which was being used before upgrade. And hence user needs to specify this. That's the whole intention of this flag. Try to bring broken configurations to user's notice. Otherwise a user will complain, hey I did not specify a graph driver and docker imposed a broken driver on me. Despite the fact that docker knows configuration is broken, it simply put a log in journal and moved on. Those who are not upgrading should not be running into this issue. |
|
@rhvgoyal I understand that. Users don't. It's easier to explain that they need to set the driver than to explain that the need to set an option for a driver they didn't select. |
|
Ok, after your patch, what's going to change? If 1.6 was using devicemapper and a user upgrades to 1.7.1, what will he/she see? Lets discuss the semantics first. I don't even fully understand what your patch is doing. |
|
My initial stance at this;
What I do agree on with @calavera is that;
Just my opinion :-) |
|
RedHat is shipping dynamically built docker in fedora, rhel, atomic, centos. So distributions should be able to ship dynamically built docker for their users. |
|
I agree that better documentation and communication is the key whenever we decide to break existing working setup. |
True, problem is that;
|
a6f3bc4 to
0fbc972
Compare
agreed
we've been doing this for a really long time, but the code is a mess. |
0fbc972 to
e34ad0f
Compare
|
|
@icecrime dunno why they fail, that's correct |
e34ad0f to
1f3e2e2
Compare
|
@icecrime they should be fixed now. |
1f3e2e2 to
0a37629
Compare
|
@rhvgoyal I made those changes. Thanks for the feedback! |
DeviceMapper must be explicitly selected because the Docker binary might not be linked to the right devmapper library. With this change, Docker fails fast if the driver detection finds the devicemapper directory but the driver is not the default option. The option `override_udev_sync_check` doesn't make sense anymore, since the user must be explicit to select devicemapper, so it's being removed. Docker fails to use devicemapper only if Docker has been built statically unless the option was explicit. Signed-off-by: David Calavera <[email protected]>
|
LGTM |
|
Tested locally, I think the output makes sense (I hope it will be clearer to the users at least...). Thanks, LGTM. |
|
Overriding docs review as I believe this is essentially a rollback of a previously added parameter. |
Fix implicit DeviceMapper selection
|
Cherry picked into #14264 |
|
@icecrime is the plan to keep "allowing" running without udev sync support, or will it be a hard failure in a future version? If so, should that be announced / part of the roadmap? |
|
@thaJeztah Honestly, I'm inclined to think this is a good final situation: it's breaking enough, and explicit enough. |
|
Right now following is the behavior.
Either way, if user forces use of devicemapper with static binary, it is running without udev sync support. libdm needs static libudev for it to work but systemd project does not allow static libudev. |
|
@icecrime alright, let's see how this works out then; we can always evaluate if too many people run into problems |
|
So after this change, how does devicemapper testing on docker work? If I generate PR, do we make sure it works with devicemapper backend otherwise CI fails? |
DeviceMapper must be explicitly selected because the Docker binary might not be linked to the right devmapper library.
With this change, Docker fails fast if the driver detection finds the devicemapper directory but the driver is not the default option.
It also makes Docker to fail fast if it detects two driver root directories.
The option
override_udev_sync_checkdoesn't make sense anymore, since the user must be explicit to select devicemapper, so it's being removed.Fixes #14035
Signed-off-by: David Calavera [email protected]