← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1501515] Re: DBReferenceError is raised when updating dvr port binding

 

Reviewed:  https://review.openstack.org/290120
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=06569179aefcc569e7a3cc1fb828f0340d38d058
Submitter: Jenkins
Branch:    master

commit 06569179aefcc569e7a3cc1fb828f0340d38d058
Author: Kevin Benton <kevin@xxxxxxxxxx>
Date:   Tue Mar 8 12:28:41 2016 -0800

    Catch DB reference errors in binding DVR ports
    
    A port can be deleted right after get_port is called but before
    the binding is created. So we need to catch both PortNotFound
    from the get_port and DBReferenceError from the binding creation.
    
    Co-Authored-By: Adolfo Duarte <adolfo.duarte@xxxxxxx>
    
    Closes-Bug: #1501515
    Change-Id: Ieddcb10bb019fe6dd7079255124e48305f406614


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

Title:
  DBReferenceError is raised when updating dvr port binding

Status in neutron:
  Fix Released

Bug description:
  several tests upstream are failing with a DBReferenceError exception when calls to 
  File "/opt/stack/new/neutron/neutron/plugins/ml2/db.py", line 208, in ensure_dvr_port_binding

  This appears to be caused by accessing database resource without
  locking it (race condition).

  Here is an excerpt of the error: 
  2015-09-29 18:39:00.822 7813 ERROR oslo_messaging.rpc.dispatcher DBReferenceError: (pymysql.err.IntegrityError) (1452, u'Cannot add or update a child row: a foreign key constraint fails (`neutron`.`ml2_dvr_port_bindings`, CONSTRAINT `ml2_dvr_port_bindings_ibfk_1` FOREIGN KEY (`port_id`) REFERENCES `ports` (`id`) ON DELETE CASCADE)') [SQL: u'INSERT INTO ml2_dvr_port_bindings (port_id, host, router_id, vif_type, vif_details, vnic_type, profile, status) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)'] [parameters: (u'851c0627-5133-43e2-b7a3-da9c29afd4ea', u'devstack-trusty-hpcloud-b2-5150973', u'973254dc-d1aa-4177-b952-2ac648bad4b5', 'unbound', '', 'normal', '', 'DOWN')]

  An example of the failure can be found here: 
  http://logs.openstack.org/17/227517/3/check/gate-tempest-dsvm-neutron-dvr/fc1efa2/logs/screen-q-svc.txt.gz?level=ERROR

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


References