You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sync the gateway flows immediately for BGP and UDN
g.openflowManager.updateBridgeFlowCache is called from a few places but
mainly from func (g *gateway) Reconcile(). However it looks like we don't
actually call g.openflowManager.requestFlowSync() once we call
cache update for the flows, so this means flows don't change immediately but wait for the
next periodic ticker of 15seconds which makes the tests fail in CI lane.
I think this is a longstanding bug that Reconcile was not calling requestFlowSync.
Let's add requestFlowSync() to inside Reconcile so that it covers mutating the
flows on the bridge immediately after the cache update. Note that in Reconcile,
we also call reconcile for service flows which each inside do requestFlowSync()
already for service flows.
This will fix immediate flowsync to be triggered from missing places for BGP and UDN like:
// reconcile subcontrollers
if reconcilePodNetwork {
isPodNetworkAdvertisedAtNode := util.IsPodNetworkAdvertisedAtNode(netInfo, oc.name)
if oc.Gateway != nil {
oc.Gateway.SetDefaultPodNetworkAdvertised(isPodNetworkAdvertisedAtNode)
err := oc.Gateway.Reconcile()
and
postFunc := func() error {
if err := udng.gateway.Reconcile(); err != nil {
return fmt.Errorf("failed to reconcile flows on bridge for network %s; error: %v", udng.GetNetworkName(), err)
}
return nil
}
and
// delete the openflows for this network
if udng.openflowManager != nil {
udng.openflowManager.delNetwork(udng.NetInfo)
if err := udng.gateway.Reconcile(); err != nil {
return fmt.Errorf("failed to reconcile default gateway for network %s, err: %v", udng.GetNetworkName(), err)
}
}
Given doReconcile() has a mind of its own for BGP, I also
explicitly added it there since that is the path my code tests
Signed-off-by: Surya Seetharaman <[email protected]>
0 commit comments