no mechanism driver calls for gateway port removal

Bug #1361540 reported by Cédric OLLIVIER
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Mathieu Rohon

Bug Description

MechanismDriver.delete_port_* (gateway port) are not called when the router is being removed.
For instance, it remains the network:router_gateway ports in OpenDaylight as its Mechanism Driver is not correctly called.

To reproduce it:
    - create a router and set the gateway
    - delete this router (without clearing the gateway)

It works well if the gateway port is cleared before the router.

Changed in neutron:
status: New → Confirmed
assignee: nobody → Oleg Bondarev (obondarev)
importance: Undecided → Medium
Changed in neutron:
assignee: Oleg Bondarev (obondarev) → Mathieu Rohon (mathieu-rohon)
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/116924

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
Mathieu Rohon (mathieu-rohon) wrote :

The bug comes from the fact that when deleting a router with a gw port, the core plugin is bypassed, the gw port is deleted directly with a method of the super class of the core plugin.

We could continue this way, and keep the capability for a l3 service plugin to delete the gw port when deleting a router, however, It seems weird that a service plugin can delete a core plugin resource.
It would be more consitant to forbid the deletion of a router when a gw port is still attached to it, since the router deletion is forbidden when any other port is attached to it (floating ip, internal port).

but this would implie backward compat issues.

thoughs?

Revision history for this message
Robert Kukura (rkukura) wrote :

If the l3 service plugin is going to delete a core resource (which is fine, as far as I'm concerned), it needs to do it via the core plugin rather than at the DB level.

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

Is this affecting selected mechanism drivers only?
I've checked with default settings and did not spot any ports left behind.

Tried with the following commands. Gateway ports were always deleted on router deletion

neutron router-create test-router-1
neutron router-gateway-set test-router-1 public
neutron router-interface-add test-router-1 test-net-sub
neutron router-interface-delete test-router-1 test-net-sub
neutron router-delete test-router-1

neutron router-create test-router-2
neutron router-gateway-set test-router-2 public
neutron router-delete test-router-2

Revision history for this message
Mathieu Rohon (mathieu-rohon) wrote :

the port is correctly deleted in Neutron DB but no MD are aware of this deletion.
It currently affects ODL MD, but could potentially affect any other MD which has to perform operations when the gw port gets deleted.

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

Thanks for the update. The gateway port then is not removed from the backends - where this kind of dangling ports will eventually pile up.

tags: added: juno-rc-potential
Revision history for this message
Kevin Benton (kevinbenton) wrote :

This affects the Big Switch MD as well.

Revision history for this message
Mathieu Rohon (mathieu-rohon) wrote :

The patch set which fixes this race condition bug : https://bugs.launchpad.net/neutron/+bug/1378866 introduces even more direct call to the DB while deleting a router, bypassing the core plugin delete_port() call.

Revision history for this message
Carl Baldwin (carl-baldwin) wrote :

Raising severity a notch due to Mathieu's most recent comment.

Changed in neutron:
importance: Medium → High
Thierry Carrez (ttx)
tags: added: juno-backport-potential
removed: juno-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 1e00041b0bcb83175760eb6347bb3eae55649328
Author: mathieu-rohon <email address hidden>
Date: Thu Jan 15 16:19:08 2015 +0100

    make delete_router send delete_port to core_plugin

    Have delete_router API call also delete the gateway port if needed.
    Currently, the db_base_plugin_v2 method is called, bypassing the
    core_plugin overload of this method. The consequence is that,
    in ML2, mechanism drivers are not aware of the port deletion.

    In this patch, tha gateway port is deleted through a common
    method. This method checks if floating IP and VPN are attached
    to the router, so those checks are removed from the delete_router
    method.

    Closes-Bug: #1361540

    Change-Id: Iae98f3fe89126a76f16ed9c5230ce299a09ce8d8

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.