From 57c86fc34fc92cb51eada86c73f66607fd9229ed Mon Sep 17 00:00:00 2001 From: Miguel Lavalle Date: Sat, 26 Oct 2019 18:43:56 -0500 Subject: [PATCH] Router synch shouldn't return unrelated routers [0] introduced the concept of connected routers: routers that are connected to the same subnets. When a L3 agent is synching a router with connected routers, the data of the entire set should be returned to the agent by the Neutron server. However, if an agent tries to synch a router with no connected routers when the same agent has other routers that are connected among them, the Neutron server returns the former and the latter. For details of how this bug can manifest itself, please see [1]. This change prevents this situation: only the synched router is returned. [0] https://review.opendev.org/#/c/597567 [1] https://bugs.launchpad.net/neutron/+bug/1838449/comments/15 Change-Id: Ibbf35d0f4a0bf9281f0bc8c411e8527eed75361d Closes-Bug: #1838449 (cherry picked from commit 48ea7da6c52ee14f0e9cc244fbc834283a8e74a7) --- neutron/db/l3_dvrscheduler_db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/db/l3_dvrscheduler_db.py b/neutron/db/l3_dvrscheduler_db.py index c6644f00000..c7e20a1ed4b 100644 --- a/neutron/db/l3_dvrscheduler_db.py +++ b/neutron/db/l3_dvrscheduler_db.py @@ -435,10 +435,10 @@ class L3_DVRsch_db_mixin(l3agent_sch_db.L3AgentSchedulerDbMixin): "serviceable ports in host %(host)s", {'router_ids': result_set, 'host': agent_db['host']}) - for dvr_router in dvr_routers: + for router_id in router_ids: result_set |= set( self._get_other_dvr_router_ids_connected_router( - context, dvr_router)) + context, router_id)) LOG.debug("Router IDs %(router_ids)s for agent in host %(host)s", {'router_ids': result_set,