Reviewed: https://review.opendev.org/c/openstack/neutron/+/852089 Committed: https://opendev.org/openstack/neutron/commit/a45cebbfcd154fbd94c4625c5092d296959bb829 Submitter: "Zuul (22348)" Branch: master
commit a45cebbfcd154fbd94c4625c5092d296959bb829 Author: Weronika Sikora <[email protected]> Date: Mon Aug 1 05:13:50 2022 +0000 Avoid unnecessary db calls with l2pop When processing ports that are incompatible with l2_population, certain methods do unnecessary db calls to retrieve agent port info from the db. This info is used only if the processed port is of the correct network type. The check is done after the db call, but before the info is used. This commit moves the check earlier in the method. The db will be called only when the port is supposed to be set up with the l2pop. Closes-Bug: #1983558 Change-Id: I5a83bfce60a933af781b1fd96037c7de6b2b1f38 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1983558 Title: l2_pop does unnecessary db fetches for incompatible network types Status in neutron: Fix Released 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.get_agent_network_active_port_count() The methods that call this are in the neutron/plugins/ml2/drivers/l2pop/mech_driver.py file and are: 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. To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1983558/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

