l2_pop does unnecessary db fetches for incompatible network types
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
High
|
Unassigned |
Bug Description
When processing ports that are "incompatible" with the l2_population driver (vlan and flat network types), certain methods do unnecessary db calls to retrieve agent port info:
l2pop_db.
The methods that call this are in the neutron/
update_port_up()
_get_agent_fdb ()
The second method is called from within update_port_down(). So the affected methods seem to get called for every single port, at least once each. That's a lot of unnecessary db calls.
The info retrieved from the db is used later in these methods, but only if the processed port is of the correct network type (vxlan, gre). It's not used if the network type is vlan or flat.
There is a check if the network type is "compatible", but it's done after the db call and before the info is used. So this makes this db fetch completely unnecessary if the network type turns out to be vlan or flat. It should be moved below the network type check to avoid unnecessary fetches.
I've finished a patch to fix this issue and will upload it shortly for review.
Changed in neutron: | |
importance: | Undecided → High |
Fix proposed to branch: master /review. opendev. org/c/openstack /neutron/ +/852089
Review: https:/