From 0e47c836e9f2e5bbbf95c35604fc89a6fa8b32ee Mon Sep 17 00:00:00 2001 From: Joao Morais Date: Thu, 26 Feb 2026 10:20:07 -0300 Subject: [PATCH] reload router if route is changed on DCM DCM (dynamic update) is removing+adding routes whenever they change. This causes disruption on the changed route, and can cause a longer outage in case the API call to add the route fails. This update is skipping the dynamic update in case of any route change, either creation, change and deletion. This is the simplest approach for the current release, a proper fix on the API calls should be done post 4.22 in the scope of https://issues.redhat.com/browse/OCPBUGS-77344 The dynamic update skip is being added just after the route registration on the AddRoute method, this ensures that the free slots can be found in case of scale out. If skipping the registration, the free slots cannot be found and scale in/out would force a reload. https://issues.redhat.com//browse/OCPBUGS-77412 --- pkg/router/template/router.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/router/template/router.go b/pkg/router/template/router.go index 6db171c12..ac8ee657b 100644 --- a/pkg/router/template/router.go +++ b/pkg/router/template/router.go @@ -788,6 +788,10 @@ func (r *templateRouter) dynamicallyAddRoute(backendKey ServiceAliasConfigKey, r log.V(4).Info("dynamically adding route backend", "backendKey", backendKey) r.dynamicConfigManager.Register(backendKey, route) + // Fully skipping DCM for now when adding or changing routes, + // should be reincluded along with the fix for https://issues.redhat.com/browse/OCPBUGS-77344 + return false + // If no initial sync was done, don't try to dynamically add the // route as we will need a reload anyway. if !r.synced { @@ -830,6 +834,10 @@ func (r *templateRouter) dynamicallyAddRoute(backendKey ServiceAliasConfigKey, r // Note: The config should have been synced at least once initially and // the caller needs to acquire a lock [and release it]. func (r *templateRouter) dynamicallyRemoveRoute(backendKey ServiceAliasConfigKey, route *routev1.Route) bool { + // Fully skipping DCM for now when adding or changing routes, + // should be reincluded along with the fix for https://issues.redhat.com/browse/OCPBUGS-77344 + return false + if r.dynamicConfigManager == nil || !r.synced { return false }