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 48ea7da6c5)
This commit is contained in:
Miguel Lavalle 2019-10-26 18:43:56 -05:00 committed by Slawek Kaplonski
parent fc6b8fc40f
commit 57c86fc34f
1 changed files with 2 additions and 2 deletions

View File

@ -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,