Commit Graph

157 Commits

Author SHA1 Message Date
55843a6210 Fix incorrect document storage-opt
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 0204ecdf707bdbb3caa76548e576f4ff0706fc46
Component: engine
2015-05-15 19:13:07 +08:00
11e5be135f Merge pull request #12190 from rhvgoyal/deferred-removal
Devicemapper: Provide deferred device removal capability
Upstream-commit: 56c991781564e8cc292166d3b3e27e304c240468
Component: engine
2015-05-04 14:22:52 -07:00
a580a2dfa9 Merge pull request #12903 from rhvgoyal/disable-discards
devmapper: Disable mount option "discard" by default
Upstream-commit: 2e49281bd085d84babe8b3243de1e97c2d12dac1
Component: engine
2015-05-04 18:35:25 +03:00
63fe58e0de devmapper: Disable mount option "discard" by default
Right now devicemapper mounts thin device using online discards by default
and passes mount option "discard". Generally people discourage usage of
online discards as they can be a drain on performance. Instead it is 
recommended to use fstrim once in a while to reclaim the space.

In case of  containers, we recommend to keep data volumes separate. So
there might not be lot of rm, unlink operations going on and there might
not be lot of space being freed by containers. So it might not matter
much if we don't reclaim that free space in pool.

User can still pass mount option explicitly using dm.mountopt=discard to
enable discards if they would like to.

So this is more like setting the containers by default for better performance
instead of better space efficiency in pool. And user can change the behavior
if they don't like default behavior.

Reported-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 04adaaf1ee1688ff48cb8f541dcb80e965f45080
Component: engine
2015-05-01 09:16:31 -04:00
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
c9ef8ab72d devmapper: Cancel deferred deactivation if device is reactivated
If device is being reactivated before it could go away and deferred 
deactivation is scheduled on it, cancel it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: ddc8acebecfdc7dbc0357f5c009fb3ee0a2ae906
Component: engine
2015-04-21 18:14:59 -04:00
be8151e80b devmapper: Export deferred removal status in status
This will help with debugging as one could just do "docker info" and figure
out of deferred removal is enabled or not.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 66a53819aea2ab1ab0d50be1f8d32fcb2427cd78
Component: engine
2015-04-21 18:14:59 -04:00
807639ca3d devmapper: Use deferred removal
Make use of deferred removal of devices.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: e37c7203bb1d840e9383ac08bf87afda3e722344
Component: engine
2015-04-21 18:14:59 -04:00
de64b1affe devmapper: Provide a new parameter dm.deferred_device_removal
Provide a new command line knob dm.deferred_device_removal which will enable
deferred device deactivation if driver and library support it.

This patch also checks for library support and driver version.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 15c158b20725fd62e2ee0a72ffaf1617852cd0d9
Component: engine
2015-04-21 18:14:59 -04:00
44fddcaf4b Merge pull request #11412 from vbatts/vbatts-dm_sync_is_required
devmapper: udev sync is a requirement
Upstream-commit: 23c12dabbdb7f895f606bbf2438599d29c53df3a
Component: engine
2015-04-10 16:52:38 -04:00
d89c51c3b5 devmapper: storage-opt override for udev sync
This provides an override for forcing the daemon to still attempt
running the devicemapper driver even when udev sync is not supported.

Intended to be a very clear impairment for those choosing to use it. If
udev sync is false, there will still be an error in the daemon logs,
even when the override is in place. The docs have an explicit WARNING.

Including link to the docs for users that encounter this daemon error
during an upgrade.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 0e21782de5c038dfa3cfdfc7655b9e6b143baa7b
Component: engine
2015-04-10 15:43:16 -04:00
25835c875f devmapper: udev sync is a requirement
closes #10664
closes #4036

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: ca628c6216ade64790dfbfe388fe4769433ec4aa
Component: engine
2015-04-06 15:17:57 -04:00
68a3810b3c devmapper: Retry device removal after 100ms instead of 10ms
Right now we try device removal at the interval of 10ms and keep on trying
till either device is removed or 10 seconds are over. That means if device
is busy, we will try 1000 times in those 10 seconds.

Sounds too high a frequency of deivce removal retrial. All the logs are
filled easily. I think it is a good idea to slow down a bit and retry at
the interval of 100ms instead of 10ms.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: c737800b7faced4b53854c8cb6766ebe58a3c3e9
Component: engine
2015-04-02 16:47:14 -04:00
a0411faab2 devmapper: Remove call to waitClose()
During device removal, we are first waiting for device to close() in a tight
loop for 10 seconds. I am not sure why do we need it. First of all we come
here once the umount() is successful so device should be free. For some reason
of device is temporarily busy, then removeDevice() logic retries device removal
logic in a loop for 10 seconds and that should cover it. Can't see why one
more 10 seoncds loop is required before attempting device removal.

One loop should be able to cover all the temporary device busy conditions and
if condition is not temporary then 10 seconds loop is not going to help anyway.

So instead of two loops of 10 seconds each, I am converting it to a single
loop of 20 seconds. May be 10 second loop is good enough but for now I am
keeping it 20 seconds to avoid any regressions.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: f74d12012c21349b2bd51d9c395a99331ff0a9a5
Component: engine
2015-04-02 16:47:14 -04:00
12beb9b276 devmapper: Remove extra wait after device removal
Currently in device removal path (device deactivation), we wait
for 10 seconds for devive to actually go away. waitRemove().

In current code this is not required. If dm removal task has completed
and one has done the wait on udev cookie, then device is gone and there
is no need to write another loop to wait for device removal.

This patch removes the waitRemove() which waits for 10 seconds after
device removal. This seems unnecessary.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: dbf04ec4e2a6b4fe73f7f300918a906c0ff1a37b
Component: engine
2015-04-02 16:47:14 -04:00
cb8a2764e5 devicemapper: Remove debug messages from RemoveDevice()
devmapper graph driver retries device removal 1000 times in case of failure
and if this fills up console with 1000 messages (when daemon is running in
debug mode). So remove these debug messages.
 
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: cb7c893275c32ddfa775c3f22869a9c211024c71
Component: engine
2015-04-02 16:47:14 -04:00
2b212c76e7 devmapper: Fix libdm logging
There are issues with libdm logging. Right now if docker daemon is run
in debug mode, logging by libdm is too verbose. And if a device can't 
be removed, thousands of messages fill the console and one can not see
what's going on.

This patch removes devicemapper.LogInitVerbose() call as that call will
only work if docker was not registering its own log handler with libdm.
For some reason docker registers one with libdm and libdm hands over
all the messages to docker (including debug ones). And now it is up to
devmapper backend to figure out which ones should go to console and
which ones should not.

So by default log only fatal messages from libdm. One can easily modify
the code to change it for debugging purposes.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: e07d3cd9acf14219f33e12375fb8c2e3fe02ad0c
Component: engine
2015-04-02 16:47:14 -04:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
ac917d33bd Fixed redundant else in GetDeviceStatus
Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
Upstream-commit: e479e1c9f7d327f396eebc46d446cf4ee34513f7
Component: engine
2015-03-25 09:53:04 +01:00
b3678f8418 Merge pull request #11076 from hqhq/hq_use_warning_in_sysinfo
use type WARN for warning
Upstream-commit: 82f390e139e611b97911c19dd1be2a98264cf4b9
Component: engine
2015-03-15 21:13:23 -07:00
b951eb79db Fix minor typo
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
Upstream-commit: ce1a0b612d300210fadf12556e1b38885f098197
Component: engine
2015-03-11 11:13:39 +08:00
ad6ee8ec46 fix warning messages
Use log.Warnf instead of log.Infof, and remove redundant `WARNING` prefix.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: bffe04b582d143f074297b260a359dfb54a7763b
Component: engine
2015-03-11 08:47:45 +08:00
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
2d25573473 Merge pull request #11106 from MabinGo/fix_log_info
Fix some revision about log output
Upstream-commit: 32ccde46dde5130adcfb170c846c8f0317761aee
Component: engine
2015-03-02 13:55:43 -08:00
d0e86ebf79 Merge pull request #11054 from MabinGo/checkfileoper1
Add the file close operation before function return to advoid resource leaking
Upstream-commit: 82aa950f4e10dbd45b16ecfc144f8d4b450ad1ff
Component: engine
2015-03-02 10:44:26 -08:00
aeb9a73d60 Merge pull request #11083 from MabinGo/minor_typo
Modify the minor typo in deviceset.go
Upstream-commit: 738bdec4908755761b27b7d15baeefb1a824f770
Component: engine
2015-03-02 13:11:14 -05:00
4a59461365 Fix some revision about log output
Signed-off-by: Mabin <bin.ma@huawei.com>
Upstream-commit: adfd1ddfc6e094295d07ff2b36fb6e91cf7878dd
Component: engine
2015-03-02 17:06:38 +08:00
f3df541809 fix typo of comments in daemon/graphdriver/devmapper/deviceset.go
Signed-off-by: Mabin <bin.ma@huawei.com>
Upstream-commit: f4ac86de84c25bf1793d1e934695b7119dc51b70
Component: engine
2015-03-02 02:11:15 +08:00
5e225bf426 Modify the minor typo in deviceset.go
Signed-off-by: Mabin <bin.ma@huawei.com>
Upstream-commit: 5c1559a754f7b1fba45be01a6f1a4b3c7c6c4c68
Component: engine
2015-02-28 18:04:10 +08:00
0fd505f748 Add the file close operation before function return to advoid resource leaking
Signed-off-by: Mabin <bin.ma@huawei.com>
Upstream-commit: b5eeab6e061d183be050143426dd7fd774c89a20
Component: engine
2015-02-28 00:24:41 +08:00
009380c706 Merge pull request #10474 from petervo/10473-availble-space
Add available space to devicemapper status output
Upstream-commit: f4dc496d36d31cf9ca1b3508f10954066ff7f8bc
Component: engine
2015-02-10 16:32:51 +01:00
7fe8a53e1c Detail available space behavior on loop devices
Signed-off-by: Peter Volpe <petervo@redhat.com>
Upstream-commit: 6816d27591a24b7a3a5b2e4c85294abffda977a2
Component: engine
2015-02-09 14:51:48 -08:00
5c8d4a0091 Merge pull request #10440 from rhvgoyal/skip-dot-prefix-files
devicemapper: Skip the files with prefix "." during device map construct...
Upstream-commit: 67a4f1db103ac726f6e3d1fe388214ba41062b78
Component: engine
2015-02-09 10:26:27 +01:00
a31c4ae7c4 Fix a small spelling error in the dm.blkdiscard docs
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: fcb975cfd17cfbe45b7f6661c2c1c4a94de04c94
Component: engine
2015-02-05 10:57:33 +10:00
cab1f7d560 Add available space to devicemapper status output
Signed-off-by: Peter Volpe <petervo@redhat.com>
Upstream-commit: 726f89d77a575c6a121829eb8fe63c1d3d6452fe
Component: engine
2015-01-30 22:36:04 -08:00
7556ae9236 devicemapper: Skip the files with prefix "." during device map construction
Any file which starts with "." is not a valid metadata file. Skip it
during device map construction.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 080a6f1e4b7c33ce9b7b1b90cbf8fd90658226c2
Component: engine
2015-01-29 13:19:18 -05:00
f11f701e04 Merge pull request #10222 from vbatts/vbatts-dm_flag_and_output
dm flag and output
Upstream-commit: 9b2afa04f8ab491d56614835de09eb0880250309
Component: engine
2015-01-20 18:45:43 -05:00
85aed8db6e devmapper: initialize log levels
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 0c8be9da3763d86c2a6e847e1667410056d6071d
Component: engine
2015-01-20 13:31:19 -05:00
62c5f93e15 devmapper: some explination of docker info
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Upstream-commit: a09a665d99c84be74ffff68a39dde83ad3c0d34a
Component: engine
2015-01-19 17:37:08 -05:00
279519e07d devicemapper: debug output specifics
moar information for the information gods

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 4cfe9df0a9c206c368a90f460fea8fab197265d9
Component: engine
2015-01-19 17:21:10 -05:00
8ae343ded1 devmapper: udev sync in docker info
now:

```
[...]
Storage Driver: devicemapper
 Pool Name: docker-253:2-5767172-pool
 [...]
 Udev Sync Supported: true
[...]
```

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: d2593546f9a234699cd0034cc6b97c748c10c93e
Component: engine
2015-01-19 16:28:02 -05:00
e54a5327c8 devmapper: udev sync on init
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>
Upstream-commit: 022e1232f84966c4b70a612bc35463ebb58e3137
Component: engine
2015-01-19 15:57:25 -05:00
310b2cd524 Add backing filesystem info to docker info command where applicable
Fixes #9960

This adds the output of a "Backing Filesystem:" entry to `docker info`
to overlay, aufs, and devicemapper graphdrivers. The default list
includes a fairly complete list of common filesystem names from
linux/include/uapi/linux/magic.h, but if the backing filesystem is not
recognized, the code will simply show "<unknown>"

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 48b1dd0084904678728817d728bb9ab1c0183aad
Component: engine
2015-01-16 14:43:43 -05:00
6d98dd3144 Fix vet error about passing Mutex by value
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: bb96e53b0f947a31a4b66e76607eed0097917ed5
Component: engine
2015-01-14 14:03:00 -08:00
94b5bf5737 Merge pull request #10003 from vbatts/vbatts-dm_loop_file_info
devmapper: show device and loop file , if used
Upstream-commit: 044d979f4ec83aac5664691d29123c34f6db68d6
Component: engine
2015-01-14 01:15:09 +02:00
87c9f594f0 Merge pull request #10047 from vbatts/vbatts-graphdriver_driver_put_with_error
graphdriver: change (*Driver).Put signature
Upstream-commit: 83ab6237ac0d58e54c2f6f9308136594774386ba
Component: engine
2015-01-12 11:42:11 -08:00
67a17d26c7 devmapper: remove newline string
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 2b51d1a167055834df331fb23c6cd373ebc06211
Component: engine
2015-01-12 13:40:42 -05:00
0e444dd64f graphdriver: change (*Driver).Put signature
There are a couple of drivers that swallow errors that may occur in
their Put() implementation.

This changes the signature of (*Driver).Put for all the drivers implemented.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Upstream-commit: 00fd63e55807c36fedf0878645dfec995fba381d
Component: engine
2015-01-12 13:34:35 -05:00
504e80c0b5 devmapper: show device and loop file , if used
Presenly the "Data file:" shows either the loopback _file_ or the block device.
With this, the "Data file:" will always show the device, and if it is a
loopback, then there will additionally be a "Data loop file:".
(Same for "Metadata file:")

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 09c033ff872334cdcc45172ac57dbf21573481ef
Component: engine
2015-01-09 11:20:07 -05:00
fb6c082460 change to lazy Unmount
syscall.Unmount failed sometimes when user interrupted exporting,
for example a Ctrl-C, or pipe to commands which closed the pipe early,
like "docker export <container_name> | file -"; this syscall.Unmount
could sometimes return EBUSY and didn't actually umount the filesystem;
which would cause a following export command fail to mount;
change to lazy Unmount with MNT_DETACH can fix the problem, this is
the same behavior as in Shutdown;

```text
time="2015-01-03T21:27:26Z" level=error msg="Warning: error unmounting device
34a3e77cdbca17ceffd0636aee0415bb412996adb12360bfe2585ce30467fa8e: device or resource busy"
```

```
$ docker export thirsty_ardinghelli | file -
/dev/stdin: POSIX tar archive
time="2015-01-03T21:58:17Z" level=fatal msg="write /dev/stdout: broken pipe"
$ docker export thirsty_ardinghelli
time="2015-01-03T21:54:33Z" level=fatal msg="Error: thirsty_ardinghelli: Error getting container
34a3e77cdbca17ceffd0636aee0415bb412996adb12360bfe2585ce30467fa8e from driver devicemapper:
Error mounting '/dev/mapper/docker-253:0-3148372-34a3e77cdbca17ceffd0636aee0415bb412996adb12360bfe2585ce30467fa8e'
on '/var/lib/docker/devicemapper/mnt/34a3e77cdbca17ceffd0636aee0415bb412996adb12360bfe2585ce30467fa8e': device or resource busy"
```

Signed-off-by: Derek Che <drc@yahoo-inc.com>
Upstream-commit: 9bbed5ab4ceaff5e78c21f0fa2d84de5ffd41f94
Component: engine
2015-01-04 00:10:48 +00:00