Skip to content

The data lost when do docker plugin upgrade action if the container is running #32515

@ningyougang

Description

@ningyougang

Description

Steps to reproduce the issue:
1.startup volume plugin for saving data to ceph through cinder.

[root@control01 propagated-mount]# docker plugin ls
ID                  NAME                DESCRIPTION          ENABLED
8923d376ce7d        ceph:latest         ceph docker plugin   true

2.create volume, such as:docker volume create --driver=ceph --name test-volume -o size=1
3.startup container attacing this volume, such as:docker run --volume-driver=ceph --volume test-volume:/data -it centos sh -c "touch /data/hello"
4.docker start ${above container}
5.do upgrade action, such as:

docker plugin disable -f ceph
docker plugin upgrade --grant-all-permissions --skip-remote-check ceph ${PLUGIN}
docker plugin enable ceph

6.login into the container, found that the /data/ directory's hello file lost.
7.journalctl -u docker, only print the important log

Apr 11 09:59:49 control01 dockerd[7745]: time="2017-04-11T09:59:49.811848619+08:00" level=warning msg="Could not unmount /var/lib/docker/plugins/f4b5158770cb041f72182c5b0bb8341cb6effe5aed7c6a10aea0e6ab18b45fad/rootfs/var/lib/ceph/mount: device or resource busy"
Apr 11 09:59:50 control01 dockerd[7745]: time="2017-04-11T09:59:50.814670410+08:00" level=warning msg="Could not unmount %s: %v/var/lib/docker/plugins/f4b5158770cb041f72182c5b0bb8341cb6effe5aed7c6a10aea0e6ab18b45fad/propagated-mountdevice or resource busy"

It seems that the docker will do unmount action if the attaching volume container is running when do docker plugin upgrade action.

Describe the results you received:
The data lost when do docker plugin upgrade action if the attaching volume container is running

Describe the results you expected:
I want to know, why my conainer's /data/hello file lost. is it docker's bug?
If i stop the attaching volume container before upgrade, the data doesn't lost(after upgrade, start container, login into container, found that the /data/hello file already exist.)

i found the docker's article for upgrade sample:https://docs.docker.com/engine/reference/commandline/plugin_upgrade/#examples, actully, this
sample's container stopped when do upgrade action. i am not sure whether testing this feature on running container condition.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

[root@control01 propagated-mount]# docker -v
Docker version 17.04.0-ce, build 4845c56

Output of docker info:

[root@control01 propagated-mount]# docker info
Containers: 13
 Running: 13
 Paused: 0
 Stopped: 0
Images: 74
Server Version: 17.04.0-ce
Storage Driver: devicemapper
 Pool Name: docker-253:0-68148518-pool
 Pool Blocksize: 65.54kB
 Base Device Size: 10.74GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 4.853GB
 Data Space Total: 107.4GB
 Data Space Available: 41.94GB
 Metadata Space Used: 13.62MB
 Metadata Space Total: 2.147GB
 Metadata Space Available: 2.134GB
 Thin Pool Minimum Free Space: 10.74GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.107-RHEL7 (2015-12-01)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: active
 NodeID: k8kdtpuyuph5jq8gv0a5yhgl8
 Is Manager: false
 Node Address: 192.168.11.138
 Manager Addresses:
  192.168.11.126:2377
Runtimes: runc
Default Runtime: runc
Init Binary: 
containerd version: 422e31ce907fd9c3833a38d7b8fdd023e5a76e73
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-327.10.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 3.451GiB
Name: control01
ID: BZUP:4YSJ:QJYG:OKZW:UIW7:PNIZ:BQXQ:OUEX:NS5N:WAXN:YDTB:44D3
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):
physical nodes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions