← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1983558] [NEW] l2_pop does unnecessary db fetches for incompatible network types

 

Public bug reported:

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.

** Affects: neutron
     Importance: Undecided
         Status: In Progress


** Tags: db l2-pop l2-population l2pop l2population

-- 
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:
  In Progress

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



Follow ups