after add_port, get_port_ofport may be called before vswitchd has assigned the ofport

Bug #1341020 reported by Terry Wilson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Terry Wilson

Bug Description

OVSBridge.add_port() runs ovs-vsctl to add the port, then runs ovs-vsctl again to query the ofport of the newly created port. The ofport gets assigned outside of any kind of transaction, and the OVS api defines an empty set response([]) to mean that the ofport assignment is still pending and a response of '-1' to mean that there is a failure.

The current get_port_ofport code treats these responses both as failures even though '[]' will most likely later succeed. We need to implement a retry mechanism to ensure that we don't incorrectly fail port creation. Raising an exception on retry expiration also seems like a good idea.

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/106517

Changed in neutron:
assignee: nobody → Terry Wilson (otherwiseguy)
status: New → In Progress
tags: added: openflowagent
Changed in neutron:
importance: Undecided → Medium
Kyle Mestery (mestery)
Changed in neutron:
milestone: none → juno-3
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-3 → juno-rc1
Revision history for this message
Kyle Mestery (mestery) wrote :

Moving medium priority bug out of Juno-RC1.

Changed in neutron:
milestone: juno-rc1 → kilo-1
Kyle Mestery (mestery)
Changed in neutron:
milestone: kilo-1 → none
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit cd78c7cc11940ee2e46e55001b2cfa6fbf0f7159
Author: Terry Wilson <email address hidden>
Date: Fri Jul 11 17:55:30 2014 -0600

    Retry on unassigned ofport instead of treating it as a failure

    Open vSwitch will return '[]' when querying an interface's ofport
    when the ofport has not yet been assigned. This doesn't signal a
    failure, but the get_port_ofport code was treating it as such.
    This patch uses a decorator from python-retrying which has been
    added as a dependency of oslo_concurrency and therefore packaged
    everywhere. The call to fetch the ofport is retried until the
    vsctl_timeout is reached and, on failure, INVALID_OFPORT is
    returned.

    The add_port function will attempt to delete the port if
    INVALID_OFPORT is returned from get_port_ofport. add_port is also
    extended to take optional Interface options so that the
    add_tunnel_port and add_patch_port functions can reuse it instead
    of just duplicating its functionality.

    Closes-Bug: #1341020
    Change-Id: Ifc52d8589c7aafd360893cb9c1cdcbf43b04ee2c

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-2 → 2015.1.0
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.