← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1676235] Re: IPAM inserts a port's IP allocations directly in the database, instead of appending them to the fixed_ips relationship of the port

 

Reviewed:  https://review.openstack.org/452501
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=7f513e547cb0fd0d5c23924d264fd53cdc6141ce
Submitter: Jenkins
Branch:    master

commit 7f513e547cb0fd0d5c23924d264fd53cdc6141ce
Author: Miguel Lavalle <malavall@xxxxxxxxxx>
Date:   Sat Apr 1 19:33:34 2017 -0500

    Add IPAllocations to the port fixed_ips
    
    Since the IPAM is currently inserting the IPAllocation objects directly
    into the DB, the make_port_dict method triggers queries to the DB when
    the fixed_ips relationship is accessed, which negatively affects the
    performance of Neutron.
    
    This patchset changes this behavior, by appending IPAllocations to the
    port's fixed_ips relationship. This change will facilitate the
    implementation of enginefacade
    
    Change-Id: Ib32509d974c8654131112234bcf19d6eae8f7cca
    Closes-Bug: #1676235


** 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/1676235

Title:
  IPAM inserts a port's IP allocations directly in the database, instead
  of appending them to the fixed_ips relationship of the port

Status in neutron:
  Fix Released

Bug description:
  When creating IPAllocation objects for a port, the IPAM inserts them
  directly in the DB, establishing the one to many relationship by
  setting the port_id foreign key (in IPAllocation):
  https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_common.py#L109.

  This behavior has detrimental performance consequences for the
  implementation of enginefacade, where we want the following pseudo-
  code behavior to take place:

  def create_port():
      with session.begin():
          p = Port()
          p.fixed_ips = [IPAllocation(1), IPAlocation(2)]
      return make_port_dict(p)  # <- iterates relationships needed for API

  Since the IPAM is currently inserting the IPAllocation objects
  directly into the DB, the make_port_dict method triggers queries to
  the DB when the fixed_ips relationship is accessed, which negatively
  affects the performance of Neutron.

  The approach to fix this is to re-factor the IPAM in such a way that
  the SQL_Alchemy object representing the port is passed to it, instead
  of just the port id. With the SQL Alchemy object, the IPAM code will
  add the IPAllocations to the fixed_ips relationship of the port.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1676235/+subscriptions


References