-
Notifications
You must be signed in to change notification settings - Fork 95
Fix the plugin upgrade flow when disable -f is used (live upgrade). #1779
Comments
Suggest only thing is to document disable -f is disallowed/unsupported. Possibly data isn;t flushed to the disk and hence doesn't re-appear after these steps. let me confirm that. |
The described data loss behavior is fixed in Docker 17.06, but enabling the plugin after upgrade is broken if it was disabled through -f option. |
@govint @shuklanirdesh82 Looks like in case if a container is running and had our volume attached, after plugin upgrade to enable the plugin, docker tries to talk to our socket before we start listening on it. See steps below.
Then I disabled the plugin using -f. It removes the vsphere.sock and the plugin id directory.
End snippet of our plugin log:
Should we instruct customers to not have containers running while upgrading the plugin? |
Looks like with docker 17.06, docker plugin disable removes /proc/mounts entries of mounted volumes. Did a quick hack to make timeout of 0s and above issue doesn't occur. The reason for this behavior is missing entry of mounted volumes in /proc/mounts for already mounted volumes. Here's how I concluded this.
Another terminal
Note above that the issue isn't with upgrade anymore. With 17.06 docker our plugin disable and subsequent enable is itself broken when a container is running. |
Or, always spin the refcount logic as a deferred activity vs. attempting to do recovery and then creating the vsphere socket. |
Does this work? On Docker 17.07. docker version Server: root@sc-rdops-vm02-dhcp-52-237:~# ps -ef|grep docker root 21223 21205 0 Aug16 ? 00:00:00 /usr/bin/docker-volume-vsphere --config /etc/docker-volume-vsphere.conf <----------- root@sc-rdops-vm02-dhcp-52-237:~# docker plugin ls root@sc-rdops-vm02-dhcp-52-237:~# kill -9 21223 root@sc-rdops-vm02-dhcp-52-237:~# docker plugin ls root@sc-rdops-vm02-dhcp-52-237:~# ps -ef|grep docker root 18481 18465 3 03:44 ? 00:00:00 /usr/bin/docker-volume-vsphere --config /etc/docker-volume-vsphere.conf <------------------ Plugin is enabled root@sc-rdops-vm02-dhcp-52-237:~# docker plugin ls root@sc-rdops-vm02-dhcp-52-237:~# ps -ef|grep docker root 18481 18465 0 03:44 ? 00:00:00 /usr/bin/docker-volume-vsphere --config /etc/docker-volume-vsphere.conf Kill plugin: root@sc-rdops-vm02-dhcp-52-237:~# ps -ef|grep docker root 18823 18805 0 03:50 ? 00:00:00 /usr/bin/docker-volume-vsphere --config /etc/docker-volume-vsphere.conf <--------- Plugin is enabled. Container is still running Container is happy: root@sc-rdops-vm02-dhcp-52-237:~# docker volume inspect tvol1 Can create a new volume , |
We should test this with plugin disable-> enable instead of plugin kill. |
This won't be entirely correct. It will still trigger the recovery, use /proc/mounts and try to mount the volumes again which are already attached. |
Container looses access to the data after plugin upgrade.
Steps:
Container was always running during the upgrade process. I had never stopped the container.
Logs have been attached at the end.
Detailed steps and their output are as follows:
Logs:
docker.txt
docker-volume-vsphere.txt
vmdk_ops.txt
The text was updated successfully, but these errors were encountered: