moby/daemon/graphdriver
Vivek Goyal bb00453e58 devmapper: Do not check for pool transaction id during old metadata migration
Current code is associating a transaction id with each device and if pool
transaction id is greater that value, then current code assumes that device
is there in pool.

Transaction id of pool is a mechanism so that during device creation and
removal one can define a transaction and during startup figure out if
transaction was complete or not. I think we are using transaction id 
throughout the code little inappropriately.

For example, if a device is being deleted, it is possible that we deleted
the device from pool but before we could delete metafile docker crashed.
When docker comes back it will think that device is in the pool (due to
device transaction id being less than pool transaction id) but device
is not in the pool.

Similary, it could happen that some data in the pool is corrupted and
during pool repair some devices are lost (without docker knowing about
it). In that case tool pool transaction id will be higher than device
transaction id and there are no guaratees that device is actually in
the pool.

So move away from this model where we think that a device is in pool if pool
transaction id is greater than device transaction Id. Per device
transaction Id just says that after device creation this should be pool's
transaction Id and nothing more.

Transaction id is per pool property (as opposed to per device property) and
will be used internally to figure out if last transaction was complete or
not and recover from failure during docker startup.  

If for some reason metafile is present but device is not in pool, then 
device activation will fail later.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2014-12-03 13:06:43 -05:00
..
aufs don't call reexec.Init from chrootarchive 2014-11-25 01:03:40 +02:00
btrfs btrfs: build tag to enable showing version info 2014-11-13 16:43:53 -05:00
devmapper devmapper: Do not check for pool transaction id during old metadata migration 2014-12-03 13:06:43 -05:00
graphtest Mknod more loopbacks for devmapper 2014-11-21 16:20:35 -08:00
overlayfs overlayfs: more helpful output when not supported 2014-11-18 22:53:04 -05:00
vfs don't call reexec.Init from chrootarchive 2014-11-25 01:03:40 +02:00
driver.go Merge pull request #7619 from alexlarsson/overlayfs 2014-11-14 22:59:59 +02:00
fsdiff.go add pkg/chrootarchive and use it on the daemon 2014-11-25 01:03:40 +02:00