Skip to content

Support dockerd and system restarts for ipvlan and macvlan networks - #2415

Merged
selansen merged 3 commits into
moby:masterfrom
arkodg:ipvlan-docker-restart-issue
Jul 26, 2019
Merged

Support dockerd and system restarts for ipvlan and macvlan networks#2415
selansen merged 3 commits into
moby:masterfrom
arkodg:ipvlan-docker-restart-issue

Conversation

@arkodg

Copy link
Copy Markdown
Contributor

This commit carries forward the work done in
#2295
and fixes two things

  1. Allows macvlan and ipvlan to be restored properly
    after dockerd or the system is restarted
  2. Makes sure the refcount for the configOnly network
    is not incremented for the above case so this network
    can be deleted after all the associated ConfigFrom networks
    are deleted

Signed-off-by: Arko Dasgupta arko.dasgupta@docker.com

@arkodg

Copy link
Copy Markdown
ContributorAuthor

PTAL @euanh@trapier

Comment threaddrivers/ipvlan/ipvlan_network.go Outdated
return false, err
}
// if driver created the networks slave link, record it for future deletion
config.CreatedSlaveLink = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am hoping CreateSlaveLink will be already set to true vlanLinkExists returns True.
If not, can you pls move this line out of if condition.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ip mac vlan code I see there is else condition with debug log "vlan already exists" . should we add similar log here for consistent purpose ?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

added the missing logs, also config.CreatedSlaveLink is already set to true, that is why we don't set it for the restart case

Comment threaddrivers/macvlan/macvlan_network.go Outdated
}
config.CreatedSlaveLink = true
} else {
logrus.Debugf("Dummy Link %s for Mac Vlan already exists", getDummyName(stringid.TruncateID(config.ID)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we have . config.CreatedSlaveLink = true in this else loop too? ( same as ipvlan code )? just to make sure "config.CreatedSlaveLink is set to True.

Comment threaddrivers/ipvlan/ipvlan_network.go
Comment threaddrivers/macvlan/macvlan_setup.go Outdated
Comment threaddrivers/macvlan/macvlan_setup.go Outdated
@selansen

Copy link
Copy Markdown
Contributor

We need second eye to review this PR.

cc : @mavenugo

@thaJeztah

Copy link
Copy Markdown
Member

this addresses #1743 ?

@arkodg

Copy link
Copy Markdown
ContributorAuthor

@thaJeztah yes, thanks, I'll edit the commit with this link

This commit carries forward the work done in
moby#2295
and fixes two things
1. Allows macvlan and ipvlan to be restored properly
after dockerd or the system is restarted
2. Makes sure the refcount for the configOnly network
is not incremented for the above case so this network
can be deleted after all the associated ConfigFrom networks
are deleted
Addresses: moby#1743
Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
@arkodg
arkodgforce-pushed the ipvlan-docker-restart-issue branch from 5479614 to 4c5094cCompareJuly 15, 2019 22:38

@selansenselansen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@selansen

Copy link
Copy Markdown
Contributor

@trapier Can you pls see if you can review it ?

@arkodg

Copy link
Copy Markdown
ContributorAuthor

PTAL @chiragtayal

Comment threaddrivers/ipvlan/ipvlan_network.go Outdated
Comment threaddrivers/macvlan/macvlan_network.go Outdated
Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
@selansen

Copy link
Copy Markdown
Contributor

@chiragtayal , pls LGTM and approve it if you are ok.
We can merge this PR.

@chiragtayalchiragtayal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
@arkodg
arkodgforce-pushed the ipvlan-docker-restart-issue branch from c39a277 to 6d382cdCompareJuly 25, 2019 23:37
@selansen

selansen commented Jul 26, 2019

Copy link
Copy Markdown
Contributor

@trapier as you already started reviewing, Pls let me know

@selansen
selansen merged commit 09cdcc8 into moby:masterJul 26, 2019
@arkodg
arkodg deleted the ipvlan-docker-restart-issue branch July 29, 2019 22:39
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Jul 30, 2019
full diff: moby/libnetwork@83d30db...09cdcc8
changes included:
- moby/libnetwork#2416 Fix hardcoded AF_INET for IPv6 address handling
- moby/libnetwork#2411 Macvlan network handles netlabel.Internal wrong
- fixesmoby/libnetwork#2410 Macvlan network handles netlabel.Internal wrong
- moby/libnetwork#2414 Allow network with --config-from to be --internal
- fixesmoby/libnetwork#2413 Network with --config-from does not honor --internal
- moby/libnetwork#2351 Use fewer modprobes
- relates to moby#38930 Use fewer modprobes
- moby/libnetwork#2415 Support dockerd and system restarts for ipvlan and macvlan networks
- carry of moby/libnetwork#2295 phantom ip/mac vlan network after a powercycle
- fixesmoby/libnetwork#1743 Phantom docker network
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Jul 31, 2019
full diff: moby/libnetwork@83d30db...09cdcc8
changes included:
- moby/libnetwork#2416 Fix hardcoded AF_INET for IPv6 address handling
- moby/libnetwork#2411 Macvlan network handles netlabel.Internal wrong
- fixesmoby/libnetwork#2410 Macvlan network handles netlabel.Internal wrong
- moby/libnetwork#2414 Allow network with --config-from to be --internal
- fixesmoby/libnetwork#2413 Network with --config-from does not honor --internal
- moby/libnetwork#2351 Use fewer modprobes
- relates to moby/moby#38930 Use fewer modprobes
- moby/libnetwork#2415 Support dockerd and system restarts for ipvlan and macvlan networks
- carry of moby/libnetwork#2295 phantom ip/mac vlan network after a powercycle
- fixesmoby/libnetwork#1743 Phantom docker network
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6f234db9fef23c591d8376f96db062e7107b658f
Component: engine
@thaJeztah

thaJeztah commented Aug 22, 2019

Copy link
Copy Markdown
Member

relates to FIELD-211
relates to ENGCORE-960
relates to ENGCORE-692

thaJeztah added a commit to thaJeztah/docker that referenced this pull request Sep 16, 2019
full diff: moby/libnetwork@83d30db...09cdcc8
changes included:
- moby/libnetwork#2416 Fix hardcoded AF_INET for IPv6 address handling
- moby/libnetwork#2411 Macvlan network handles netlabel.Internal wrong
- fixesmoby/libnetwork#2410 Macvlan network handles netlabel.Internal wrong
- moby/libnetwork#2414 Allow network with --config-from to be --internal
- fixesmoby/libnetwork#2413 Network with --config-from does not honor --internal
- moby/libnetwork#2351 Use fewer modprobes
- relates to moby#38930 Use fewer modprobes
- moby/libnetwork#2415 Support dockerd and system restarts for ipvlan and macvlan networks
- carry of moby/libnetwork#2295 phantom ip/mac vlan network after a powercycle
- fixesmoby/libnetwork#1743 Phantom docker network
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6f234db)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Sep 17, 2019
full diff: moby/libnetwork@83d30db...09cdcc8
changes included:
- moby/libnetwork#2416 Fix hardcoded AF_INET for IPv6 address handling
- moby/libnetwork#2411 Macvlan network handles netlabel.Internal wrong
- fixesmoby/libnetwork#2410 Macvlan network handles netlabel.Internal wrong
- moby/libnetwork#2414 Allow network with --config-from to be --internal
- fixesmoby/libnetwork#2413 Network with --config-from does not honor --internal
- moby/libnetwork#2351 Use fewer modprobes
- relates to moby/moby#38930 Use fewer modprobes
- moby/libnetwork#2415 Support dockerd and system restarts for ipvlan and macvlan networks
- carry of moby/libnetwork#2295 phantom ip/mac vlan network after a powercycle
- fixesmoby/libnetwork#1743 Phantom docker network
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6f234db9fef23c591d8376f96db062e7107b658f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b6190c2713623ab455d29da4771b684e4eafc63f
Component: engine
burnMyDread pushed a commit to burnMyDread/moby that referenced this pull request Oct 21, 2019
full diff: moby/libnetwork@83d30db...09cdcc8
changes included:
- moby/libnetwork#2416 Fix hardcoded AF_INET for IPv6 address handling
- moby/libnetwork#2411 Macvlan network handles netlabel.Internal wrong
- fixesmoby/libnetwork#2410 Macvlan network handles netlabel.Internal wrong
- moby/libnetwork#2414 Allow network with --config-from to be --internal
- fixesmoby/libnetwork#2413 Network with --config-from does not honor --internal
- moby/libnetwork#2351 Use fewer modprobes
- relates to moby#38930 Use fewer modprobes
- moby/libnetwork#2415 Support dockerd and system restarts for ipvlan and macvlan networks
- carry of moby/libnetwork#2295 phantom ip/mac vlan network after a powercycle
- fixesmoby/libnetwork#1743 Phantom docker network
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: zach <Zachary.Joyner@linux.com>
Sign up for freeto 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.

4 participants

@arkodg@selansen@thaJeztah@chiragtayal