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

Tolerate multiple OvS bridges on the same host #120

Open
wants to merge 1 commit into
base: add-kos
Choose a base branch
from

Conversation

matte21
Copy link
Collaborator

@matte21 matte21 commented Aug 6, 2020

Before this PR the OvS network fabric does NOT tolerate the existence of other OvS bridges on its host (besides its own OvS bridge) when listing pre-existing local network interfaces.

"Does not tolerate" means that it considers pre-existing local network interfaces connected to OvS bridges other than its own as connected to its own OvS bridge, and this means that in certain scenarios it can delete such "external" network interfaces.

This PR fixes that behavior: the OvS fabric now only considers pre-existing local network interfaces connected to its own bridge.

This PR is orthogonal to #119.

Make OvS network fabric tolerate multiple bridges on the host when
listing all pre-existing local network interfaces connected to its
bridge.
// rather than one separate command per interface).
func (f *ovsFabric) newGetIfcsOFPortsCmd(ifcs []string) *exec.Cmd {
cmdArgs := []string{"get", "interface"}
ifcsJoinedForCmd := strings.Join(ifcs, " ofport -- get interface ")
Copy link
Collaborator Author

@matte21 matte21 Aug 6, 2020

Choose a reason for hiding this comment

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

Consider the "--" between "ofport" and "get interface".
It is "ovs-vsctl" syntax for executing multiple commands (separated by "--") within a single transaction.
Within a single transaction also means within a single command which also means a single fork + exec.
This approach is more scalable than the more intuitive approach of retrieving the OpenFlow port number for each interface separately (1 fork + exec for every interface); see here for a sloppy perf comparison.
The drawback is that we're conflating logically independent commands in a single transaction, if there are many of them the likelihood of at least one of them failing increases and if that happens the whole command fails. But OvS has a reputation for being very reliable, so IMO it is worth it.

@matte21 matte21 changed the title Tolerate multiple OvS bridges Tolerate multiple OvS bridges on the same host Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant