← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1556178] Re: ipallocation instances live between retries

 

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

commit 7d9169967fca3d81076cf60eb772f4506735a218
Author: Kevin Benton <kevin@xxxxxxxxxx>
Date:   Sun Mar 13 20:52:09 2016 -0700

    Add IPAllocation object to session info to stop GC
    
    This adds the IPAllocation object created in the _store_ip_allocation
    method to the session info dictionary to prevent it from being
    immediately garbage collected. This is necessary because otherwise a
    new persistent object will be created when the fixed_ips relationship
    is referenced during the rest of the port create/update opertions.
    This persistent object will then interfere with a retry operation
    that uses the same session if it tries to create a conflicting record.
    
    By preventing the object from being garbage collected, the reference
    to fixed IPs will re-use the newly created sqlalchemy object instead
    which will properly be cleaned up on a rollback.
    
    This also removes the 'passive_delete' option from the fixed_ips
    relationship on ports because IPAllocation objects would now be
    left in the session after port deletes. At first glance, this might
    look like a performance penalty because fixed_ips would be looked
    up before port deletes; however, we already do that in the IPAM
    code as well as the ML2 code so this relationship is already being
    loaded on the delete_port operation.
    
    Closes-Bug: #1556178
    Change-Id: Ieee1343bb90cf111c55e00b9cabc27943b46c350


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

Title:
  ipallocation instances live between retries

Status in neutron:
  Fix Released

Bug description:
  The retry decorator doesn't clear the session between each retry. This
  is normally not an issue; however, if some called code holds onto a
  reference a reference of a DB object that will conflict with a newly
  created one, we will get errors like the following:

  FlushError: New instance <IPAllocation at 0x7fd98001ce50> with
  identity key (<class 'neutron.db.models_v2.IPAllocation'>,
  (u'10.0.0.2', u'70dfccfd-f18a-423b-9323-095a38b301a9', u'4e0d6054-6f90
  -450d-87d6-fb86fa194a91')) conflicts with persistent instance
  <IPAllocation at 0x7fd9805aa910>

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


References