Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

graphdriver: fail earlier on existing driver#44

Merged
euank merged 1 commit intocoreos:coreos-1.12.6from
euank:fail-faster
Oct 19, 2017
Merged

graphdriver: fail earlier on existing driver#44
euank merged 1 commit intocoreos:coreos-1.12.6from
euank:fail-faster

Conversation

@euank
Copy link

@euank euank commented Oct 18, 2017

Prior to this change it was possible to end up with a running dockerd
which, when restarted, would fail due to multiple graphdrivers.

The obvious example of how to get into this state is the following:

  1. start dockerd with -s overlay2
    This creates /var/lib/docker/overlay2
  2. start dockerd with no -s flag
    This detects overlay2 and thinks it's okay since there's only one,
    but then since overlay2 is not in the priority list, it ends up going
    with overlay. Now overlay2 and overlay exist.
  3. restart dockerd with no changes
    It now detects both overlay2 and overlay and falls over

This change is intended to make case 2 impossibe. If a restart of
dockerd with no flag changes will reliably fail next time, it should
fail now too.

Implementation wise, this just checks that the driver that will be used
matches the existing one.

@euank
Copy link
Author

euank commented Oct 18, 2017

Manual testing done:

  1. started on 17.09 (overlay2), downgraded, watched it fail immediately.
  2. The above, but ensured -s overlay2 made it work correctly again.
  3. The above, but with -s overlay which also works
  4. Verified restarting the daemon with no -s and no data directory a couple times worked

Prior to this change it was possible to end up with a running dockerd
which, when restarted, would fail due to multiple graphdrivers.

The obvious example of how to get into this state is the following:

1) start dockerd with `-s overlay2`
   This creates `/var/lib/docker/overlay2`
2) start dockerd with no `-s` flag
   This detects overlay2 and thinks it's okay since there's only one,
   but then since overlay2 is not in the priority list, it ends up going
   with overlay. Now `overlay2` and `overlay` exist.
3) restart dockerd with no changes
   It now detects both overlay2 and overlay and falls over

This change is intended to make case 2 impossibe. If a restart of
dockerd with no flag changes will reliably fail next time, it should
fail now too.

Implementation wise, this just checks that the driver that will be used
matches the existing one.
@euank euank merged commit d9ad3fc into coreos:coreos-1.12.6 Oct 19, 2017
@euank euank deleted the fail-faster branch October 19, 2017 00:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants