"port" resource is not deleted if child "ml2_port_bindings" DB register does not exist

Bug #1988323 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Rodolfo Alonso

Bug Description

The "port" database register (and any other related register) are not deleted from the database if the child "ml2_port_bindings" register is not present.

When a "port" database register is created, a "ml2_port_bindings" child register is created too. Initially, the "ml2_port_bindings" is set to unbound. The Neutron server deletes the "ml2_port_bindings" register when the "port" register is deleted (for example, when the user executes "openstack port delete <port>").

However, we have seen a user that has manually deleted the "ml2_port_bindings" register. In this case when the port is show, we can see all the binding related attributes filled with "None" [1].

If we manually try to delete this port using the CLI, the OSC does not return any exception, but the port is still in the database.

I know this situation is not part of the normal operation, it implies a manual manipulation of the database. However, in this case we should:
1) Raise an exception saying that the Neutron API is not deleting this port.
2) Actually delete the register (I'm in favor of this one).

[1]https://paste.opendev.org/show/bp2PPtNVN3ln4PReuByP/

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/857490

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.opendev.org/c/openstack/neutron/+/857490
Committed: https://opendev.org/openstack/neutron/commit/2f0919f7df9a7e6a7e22c428e40f324fff88ef24
Submitter: "Zuul (22348)"
Branch: master

commit 2f0919f7df9a7e6a7e22c428e40f324fff88ef24
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 1 12:22:43 2022 +0200

    Accept a port deletion with missing port binding information

    If the database "port" child register "ml2_port_bindings" has been
    manually deleted from the database, now is possible to delete the
    Neutron Port resource (that implies the "port" database register and
    all other child registers)

    Before this patch, the port deletion CLI command succeeded (no exception
    was raised) but the Port resource was not deleted.

    Closes-Bug: #1988323
    Change-Id: I02de276d0cd8e4ae27355d4aee5f48e92634f318

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/neutron/+/860069

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/neutron/+/860071

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/860072

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/860069
Committed: https://opendev.org/openstack/neutron/commit/4df578bdede4462fc211d53dc2ad395eaf964dce
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 4df578bdede4462fc211d53dc2ad395eaf964dce
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 1 12:22:43 2022 +0200

    Accept a port deletion with missing port binding information

    If the database "port" child register "ml2_port_bindings" has been
    manually deleted from the database, now is possible to delete the
    Neutron Port resource (that implies the "port" database register and
    all other child registers)

    Before this patch, the port deletion CLI command succeeded (no exception
    was raised) but the Port resource was not deleted.

    Closes-Bug: #1988323
    Change-Id: I02de276d0cd8e4ae27355d4aee5f48e92634f318
    (cherry picked from commit 2f0919f7df9a7e6a7e22c428e40f324fff88ef24)

tags: added: in-stable-zed
tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/860071
Committed: https://opendev.org/openstack/neutron/commit/d2f3499c7425940d3cc6d6717092f2193576eb85
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit d2f3499c7425940d3cc6d6717092f2193576eb85
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 1 12:22:43 2022 +0200

    Accept a port deletion with missing port binding information

    If the database "port" child register "ml2_port_bindings" has been
    manually deleted from the database, now is possible to delete the
    Neutron Port resource (that implies the "port" database register and
    all other child registers)

    Before this patch, the port deletion CLI command succeeded (no exception
    was raised) but the Port resource was not deleted.

    Closes-Bug: #1988323

    Conflicts:
        neutron/plugins/ml2/plugin.py

    Change-Id: I02de276d0cd8e4ae27355d4aee5f48e92634f318
    (cherry picked from commit 2f0919f7df9a7e6a7e22c428e40f324fff88ef24)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/860072
Committed: https://opendev.org/openstack/neutron/commit/9f3bec03fdd22f6f8f70a58f7a5e5c4a7dafc776
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 9f3bec03fdd22f6f8f70a58f7a5e5c4a7dafc776
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 1 12:22:43 2022 +0200

    Accept a port deletion with missing port binding information

    If the database "port" child register "ml2_port_bindings" has been
    manually deleted from the database, now is possible to delete the
    Neutron Port resource (that implies the "port" database register and
    all other child registers)

    Before this patch, the port deletion CLI command succeeded (no exception
    was raised) but the Port resource was not deleted.

    Closes-Bug: #1988323

    Conflicts:
        neutron/plugins/ml2/plugin.py

    Change-Id: I02de276d0cd8e4ae27355d4aee5f48e92634f318
    (cherry picked from commit 2f0919f7df9a7e6a7e22c428e40f324fff88ef24)
    (cherry picked from commit d2f3499c7425940d3cc6d6717092f2193576eb85)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.5.0

This issue was fixed in the openstack/neutron 19.5.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 22.0.0.0rc1

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 20.3.0

This issue was fixed in the openstack/neutron 20.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 21.1.0

This issue was fixed in the openstack/neutron 21.1.0 release.

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.