Segments plugin with ML2 core plugin not storing in the DB the segmentation_id attribute when creating a segment

Bug #1698596 reported by Miguel Lavalle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Miguel Lavalle

Bug Description

With ML2 as the core plugin, the segmentation_id of a newly created segment is assigned by a type manager that is executed by a callback subscribed to this PRECOMMIT_CREATE notification: https://github.com/openstack/neutron/blob/master/neutron/services/segments/db.py#L114. Since the new_segment.create() OVO call is one line above the notification, the segmentation_id attribute doesn't get stored in the DB.

This can have various undesired results. As an example, with segment type VLAN and under Python 2.7, such a segment might never be released when not used anymore. This is because the VLAN type code will determine here https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/type_vlan.py#L221 that the is outside the configured tenant vlan ranges and the corresponding DB row will never be updated as not allocated. This same example under Python 3.5 generates the following exception in the Neutron server: http://paste.openstack.org/show/612964/

Miguel Lavalle (minsel)
Changed in neutron:
assignee: nobody → Miguel Lavalle (minsel)
importance: Undecided → High
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/475151

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

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

commit 323c29fd054913493325ad0e987007181fb48976
Author: Miguel Lavalle <email address hidden>
Date: Sat Jun 17 19:49:32 2017 -0500

    Store segmentation_id during segment create

    The segmentation_id of a new segment is assigned by the
    _handle_segment_change callback in the ML2 plugin, which is executed
    after the segment was created, before commiting it to the DB. This
    patchset adds code to update the newly created segment with the
    segmentation_id assigned by the callback.

    Change-Id: I493278a0bf5a3a0aadad10e5bee546d83b949fdc
    Closes-Bug: #1698596

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.0.0b3

This issue was fixed in the openstack/neutron 11.0.0.0b3 development milestone.

tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
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.