Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control-plane hardening: cleanup local state on peer leaving a network #1704

Merged
merged 1 commit into from
Apr 10, 2017

Conversation

sanimej
Copy link

@sanimej sanimej commented Mar 31, 2017

When the last task on an overlay network is shutdown, the node will leave from the network. Once a node leaves the network subsequence bulksync updates won't include the state for that network. If a bunch of tasks on a network are shutdown when there other network issues some of the gossip updates might be lost. If the network leave event does reach the peers they should cleanup the local state. Not doing so will leave the missed gossip state updates permanently in the peers' networkdb.

Signed-off-by: Santhosh Manohar santhosh@docker.com

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
@sanimej sanimej changed the title control-plane hardning: cleanup local state on peer leaving a network control-plane hardening: cleanup local state on peer leaving a network Mar 31, 2017
@@ -372,6 +372,37 @@ func (nDB *NetworkDB) deleteNetworkEntriesForNode(deletedNode string) {
nDB.Unlock()
}

func (nDB *NetworkDB) deleteNodeNetworkEntries(nid, node string) {
nDB.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary or can we avoid to to lock the nDB around the walk ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aboch We have to take the lock in this case since the network DB entries have to updated.

@mavenugo
Copy link
Contributor

LGTM

1 similar comment
@aboch
Copy link
Contributor

aboch commented Apr 10, 2017

LGTM

@aboch aboch merged commit b09185d into moby:master Apr 10, 2017
@sanimej sanimej deleted the cphard branch April 19, 2017 20:55
sanimej pushed a commit that referenced this pull request Jun 25, 2017
backport libnetwork #1704 to 1.13/17.03 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants