Skip to content

Conversation

@calavera
Copy link
Contributor

@calavera calavera commented Jun 3, 2015

dockercompat

See for details #13695

Signed-off-by: David Calavera david.calavera@gmail.com

@thaJeztah
Copy link
Member

ping @ibuildthecloud @cpuguy83 PR for the downgrade issue

@crosbymichael
Copy link
Contributor

Downgrades have never worked

@icecrime
Copy link
Contributor

icecrime commented Jun 3, 2015

@crosbymichael Is that to say that we shouldn't even consider this PR?

@icecrime
Copy link
Contributor

icecrime commented Jun 3, 2015

Agreed on IRC that we should close this PR.

@icecrime
Copy link
Contributor

icecrime commented Jun 5, 2015

Reopening in light of the recent conversations on #13695. Does this fully resolve the issue?

@calavera
Copy link
Contributor Author

calavera commented Jun 5, 2015

There is some data migration handling that I can fix here.

@calavera calavera force-pushed the volume_backwards branch from 80ba9de to 60398da Compare June 5, 2015 19:38
@calavera
Copy link
Contributor Author

calavera commented Jun 5, 2015

This changes the local storage layout a little bit to allow Downgrade Docker 1.7 to Docker 1.6, only if a volume was created with Docker < 1.7.

History:

Pre 1.7m, volume information was stored in two separated directories:

  1. The volume configuration was in ROOT/volumes/VOLUME_ID/config.json.
  2. The data stored in the volumes was in ROOT/vfs/dir/VOLUME_ID.

Post 1.7, volume information is stored in one place, ROOT/volumes/VOLUME_ID/_data.

The docker daemon takes care of migrating volumes from 1.6 to 1.7 by creating a symlink from ROOT/vfs/dir/VOLUME_ID to ROOT/volumes/VOLUME_ID/_data. The file config.json is preserved, so you can boot the container with Docker 1.6 and all the information is in the same place that it was before booting Docker 1.7.

Unfortunately, the two previous RCs for 1.7 didn't follow that migration, so there is a special migration for volumes created with Docker 1.7 RC1 and Docker 1.7 RC2. This is a very small corner case, I don't expect anyone running Docker 1.7 RC in production, except us, ouch.

@calavera calavera force-pushed the volume_backwards branch 3 times, most recently from c721062 to 43527c0 Compare June 5, 2015 20:56
@thaJeztah
Copy link
Member

Thanks @calavera! Is an additional test needed to check if docker rm -v properly cleans up all locations and the symlinks?

@calavera calavera force-pushed the volume_backwards branch from 43527c0 to 9952f22 Compare June 5, 2015 22:32
@calavera
Copy link
Contributor Author

calavera commented Jun 5, 2015

good catch @thaJeztah, fixed.

@thaJeztah
Copy link
Member

Thanks! ❤️

@calavera calavera force-pushed the volume_backwards branch from 9952f22 to dbf9422 Compare June 8, 2015 22:17
@icecrime
Copy link
Contributor

icecrime commented Jun 9, 2015

I'm not sure we should bother with previous RC migration paths. Nevertheless, LGTM: I'm not 100% confident because the change is quite significant, but reading several times through it it seems good (and thanks for the code comments btw).

Copy link
Contributor

Choose a reason for hiding this comment

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

@calavera >= 1.7

@calavera calavera force-pushed the volume_backwards branch from dbf9422 to ed71ee2 Compare June 9, 2015 18:54
@calavera
Copy link
Contributor Author

calavera commented Jun 9, 2015

@tiborvass I think the comments are more clear now, let me know what you think.

Signed-off-by: David Calavera <david.calavera@gmail.com>
@icecrime
Copy link
Contributor

I was concerned about using prefix test on paths at first, but considering that filepath.EvalSymLink does a filepath.Clean before returning I think we're safe.

Still LGTM.

@tiborvass
Copy link
Contributor

LGTM

icecrime pushed a commit that referenced this pull request Jun 10, 2015
Allow to downgrade local volumes from > 1.7 to 1.6.
@icecrime icecrime merged commit 55bdb51 into moby:master Jun 10, 2015
@jessfraz
Copy link
Contributor

cherry-picked

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.

7 participants