phantom ip/mac vlan network after a powercycle
I am trying to address https://github.com/docker/libnetwork/issues/1743 as part of this PR.
There are two issues as part of this
-
When a node is power cycled unplanned or dockerd goes through a restart (unplanned), swarm scope networks are not cleaned up, Infact they are recreated when the docker daemon starts. This recreate does not work as there is already a swarmScope network has been restored and uses the same uplink. FIX: there was an earlier PR that tackled this problem by simply deleting the network if its created with same ID. As per comments in that PR, it was preferred to re-use instead of delete. In this PR, I am trying to essentially re-use the same network ID.
-
Even if the swarm Scope network can be recreated there is still a problem with config-only network. As there is an additional createNetwork after the docker daemon restarts. The endpoint count on the configOnly network becomes more than what it should be. Consider the case where node has been kicked out of swarm during this unplanned reboot and added back in. I believe a swarm scope network to its config-only network is a one to one mapping for a particular worker node. If thats not the case, then more work is required for this PR. But if that is the case, there is no real need to track the endpoint count. FIX: Upon deleteNetwork of a swarm scope network, the correspnding configOnly Network endpoint count is zeroed out essentially making configOnly network as deleteable.
Please sign your commits following these rules: https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work The easiest way to do this is to amend the last commit:
$ git clone -b "issue1743" [email protected]:rnataraja/libnetwork.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f
Amending updates the existing PR. You DO NOT need to open a new one.
@fcrisciani what are your thoughts on these changes.
is any progress about this PR?
still present in 18.09.1
+1
still on 18.09.2
+1
@rnataraja still there ? :)
thanks for driving this issue @rnataraja , I'll be taking this PR forward using https://github.com/docker/libnetwork/pull/2415
thanks for driving this issue @rnataraja , I'll be taking this PR forward using #2415
Thanks @arkodg
@arkodg @selansen this was carried in https://github.com/docker/libnetwork/pull/2415, which is now merged, so this one can be closed
I am still seeing this Version: 24.0.4
Subscribed to watch for a fix.
/cc @akerouanton