L3 router is doing schedule_routers when adding/removing external gateway

Bug #1995972 reported by Quentin GROLLEAU
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Confirmed
Medium
Unassigned

Bug Description

Hello all !

When I add or remove an external gateway on L3 router, neutron will always choose new agents (candidates ) and try to bind the router to them.

Of course it will realize afterwards that the router already has agents and that it should not do it but it takes some time ( few seconds when you have a lot of l3-agents ) to choose the agents and try to bind the router on them.

Step to reproduce :
openstack router create router1
openstack router set --external-gateway Ext-Net router1

Logs that shows it :

Unable to find a vacant binding_index for router <router-id> and agent <agent_id> bind_router /opt/openstack/neutron/lib/python3.6/site-packages/neutron/scheduler/l3_agent_scheduler.py:198

We are running Neutron openstack stein in HA configured

We can improve the creation time by setting schedule_routers to False in the routers_updated function :
https://github.com/openstack/neutron/blob/master/neutron/db/l3_db.py#L2142-L2143

This will avoid going into :
https://github.com/openstack/neutron/blob/master/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py#L135

And then :
https://github.com/openstack/neutron/blob/master/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py#L97

And it will avoid going into `plugin.schedule_routers(adminContext, router_ids)`

Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.