Skip to content

Commit

Permalink
fix retries for node events in udn
Browse files Browse the repository at this point in the history
See https://github.com/ovn-org/ovn-kubernetes/blob/master/go-controller/pkg/ovn/default_network_controller.go#L920
In UDN L3/L2 controllers we were missing
checking for mgmtPortFailed and accounting for that
as part of nodeupdates. So retry for any errors from
syncManagementPort was not happening.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
  • Loading branch information
tssurya committed Sep 18, 2024
1 parent b0dd59b commit 12b9838
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions go-controller/pkg/ovn/secondary_layer2_network_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,18 @@ func (h *secondaryLayer2NetworkControllerEventHandler) UpdateResource(oldObj, ne
if newNodeIsLocalZoneNode {
var nodeSyncsParam *nodeSyncs
if h.oc.isLocalZoneNode(oldNode) {
// determine what actually changed in this update
syncMgmtPort := macAddressChanged(oldNode, newNode, h.oc.NetInfo.GetNetworkName()) || nodeSubnetChanged

// determine what actually changed in this update and combine that with what failed previously
_, mgmtUpdateFailed := h.oc.mgmtPortFailed.Load(newNode.Name)
shouldSyncMgmtPort := mgmtUpdateFailed ||
macAddressChanged(oldNode, newNode, h.oc.NetInfo.GetNetworkName()) ||
nodeSubnetChanged
_, gwUpdateFailed := h.oc.gatewaysFailed.Load(newNode.Name)
shouldSyncGW := gwUpdateFailed ||
gatewayChanged(oldNode, newNode) ||
hostCIDRsChanged(oldNode, newNode) ||
nodeGatewayMTUSupportChanged(oldNode, newNode)

nodeSyncsParam = &nodeSyncs{syncMgmtPort: syncMgmtPort, syncGw: shouldSyncGW}
nodeSyncsParam = &nodeSyncs{syncMgmtPort: shouldSyncMgmtPort, syncGw: shouldSyncGW}
} else {
klog.Infof("Node %s moved from the remote zone %s to local zone %s.",
newNode.Name, util.GetNodeZone(oldNode), util.GetNodeZone(newNode))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (h *secondaryLayer3NetworkControllerEventHandler) UpdateResource(oldObj, ne
_, nodeSync := h.oc.addNodeFailed.Load(newNode.Name)
_, failed := h.oc.nodeClusterRouterPortFailed.Load(newNode.Name)
clusterRtrSync := failed || nodeChassisChanged(oldNode, newNode) || nodeSubnetChanged
_, failed = h.oc.mgmtPortFailed.Load(newNode.Name)
syncMgmtPort := failed || macAddressChanged(oldNode, newNode, h.oc.GetNetworkName()) || nodeSubnetChanged
_, syncZoneIC := h.oc.syncZoneICFailed.Load(newNode.Name)
syncZoneIC = syncZoneIC || zoneClusterChanged
Expand Down

0 comments on commit 12b9838

Please sign in to comment.