Skip to content

Commit 84ed994

Browse files
committed
[openflow manager] allow patch port ofport change for UDNs.
With the high load, UDN can be re-created and node-nad-controller needs more time to update bridge config than zone-nad-controller, which re-creates the external switch and causes ofport change. Under high load node-nad-controller may miss delete+update NAD event, so it will lawfully think that the network hasn't changed, while zone-nad-controller can re-create the external switch, and that would require a network re-create on the node side. Consider assigned network ID to re-create network if the ID has changed. Signed-off-by: Nadia Pinaeva <[email protected]>
1 parent 0b38e62 commit 84ed994

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

go-controller/pkg/node/openflow_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ func checkPorts(netConfigs []*bridgeUDNConfiguration, physIntf, ofPortPhys strin
275275

276276
}
277277
if netConfig.ofPortPatch != curOfportPatch {
278-
if netConfig.isDefaultNetwork() || curOfportPatch != "" {
278+
if netConfig.isDefaultNetwork() {
279279
klog.Errorf("Fatal error: patch port %s ofport changed from %s to %s",
280280
netConfig.patchPort, netConfig.ofPortPatch, curOfportPatch)
281281
os.Exit(1)
282282
} else {
283-
klog.Warningf("Patch port %s removed for existing network", netConfig.patchPort)
283+
klog.Warningf("UDN patch port %s changed for existing network from %v to %v. Expecting bridge config update.", netConfig.patchPort, netConfig.ofPortPatch, curOfportPatch)
284284
}
285285
}
286286
}

go-controller/pkg/util/multi_network.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,11 @@ func (nInfo *secondaryNetInfo) canReconcile(other NetInfo) bool {
822822
if nInfo == nil && other == nil {
823823
return true
824824
}
825+
// if network ID has changed, it means the network was re-created, and all controllers
826+
// should execute delete+create instead of update
827+
if nInfo.GetNetworkID() != types.InvalidID && other.GetNetworkID() != types.InvalidID && nInfo.GetNetworkID() != other.GetNetworkID() {
828+
return false
829+
}
825830
if nInfo.netName != other.GetNetworkName() {
826831
return false
827832
}

0 commit comments

Comments
 (0)