ml2 create extension processing racey

Bug #1556139 reported by Kevin Benton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Critical
Kevin Benton

Bug Description

The change to make the create result for networks and ports the same as the get result[1] changed create_port and create_network to call get_port and get_network (respectively) before returning. The issue with this approach is that the port or network can be deleted between when the record was committed and when the get operation is called. This results in the operations throwing a port or network not found error, which makes no sense in the context of a create.

1. https://github.com/openstack/neutron/commit/b6d091279fffe441f6d28e687313ad031a24a3ec

Tags: api
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/291765

Changed in neutron:
status: New → In Progress
tags: added: api
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/291765
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3ab6f8fb4539136fc193c722be98926701da6b32
Submitter: Jenkins
Branch: master

commit 3ab6f8fb4539136fc193c722be98926701da6b32
Author: Kevin Benton <email address hidden>
Date: Fri Mar 11 06:57:01 2016 -0800

    Extend dicts with original model in create/update

    This adjusts the logic in ML2 create port and create
    network to use the original DB object created rather
    than attempting to retrieve it from the DB again.
    This eliminates the race window where the object could
    be deleted out from underneath the create operations
    resulting in a 404.

    To achieve this it adds a create_port_db and
    create_network_db method to db_base_plugin_v2 that
    returns the original model instead of returning a
    dictionary.

    This also adds a skip to a unit test that was using DB
    events to trigger a rollback and retry. This test was
    causing failures with a FlushError conflict between an
    SQL alchemy new instance and a persistent instance in
    the session. This bug is fixed in the follow-up patch.

    Closes-Bug: #1556139
    Related-Bug: #1556178
    Change-Id: I3c4b4cb4f63236fca24abaf58881879c2d5657fa

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 8.0.0.0rc1

This issue was fixed in the openstack/neutron 8.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.