Comment 16 for bug 2002687

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/877712
Committed: https://opendev.org/openstack/neutron/commit/e5d4499672fe4e4e57a24ae3194d3adaefe7be15
Submitter: "Zuul (22348)"
Branch: master

commit e5d4499672fe4e4e57a24ae3194d3adaefe7be15
Author: Frode Nordahl <email address hidden>
Date: Thu Mar 16 09:48:02 2023 +0100

    [ovn] Drop use of LR OVN_GW_NETWORK_EXT_ID_KEY

    An update to the OVN QoS driver to support the `qos_gateway_ip`
    QoS extension [0] introduced adding the GW network id as an
    external_id on the Logical_Router (LR). This is problematic
    when introducing multiple gateway ports, because a single LR
    can have gateways in multiple networks.

    The external_id key was presumably added because at the point in
    time when a LR is deleted, the code had no other source of this
    information. However, it turns out this step is redundant and
    not neccessary.

    To prove this I include a excerpt of a stack trace when deleting
    a router in the commit message:

        File "services/ovn_l3/plugin.py", line 210, in delete_router
          super(OVNL3RouterPlugin, self).delete_router(context, id)
        File "db/l3_db.py", line 612, in delete_router
          self._delete_current_gw_port(context, id, router, None)
        File "db/l3_db.py", line 452, in _delete_current_gw_port
          self._core_plugin.delete_port(
        File "plugins/ml2/drivers/ovn/mech_driver/mech_driver.py",
            line 886, in delete_port_postcommit
          self._ovn_client.delete_port(context.plugin_context, port['id'],
        File "plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py",
            line 830, in delete_port
          self._delete_port(port_id, port_object=port_object)

    Essentially, a routers GW port(s) will be removed prior to
    deleting the router itself.

    The `ovn_client.delete_port` method will call on the QoS extension
    to remove rules matching the GW port, and that will be the same
    rules as has previously been added for the router.

    I also added a functional test that confirms this fact [1].

    0: I46864b9234af64f190f6b6daebfd94d2e3bd0c17
    1: Ic92a7b3bd73920d08dee41974bfe3aeb1c64b557

    Partial-Bug: #2002687
    Signed-off-by: Frode Nordahl <email address hidden>
    Needed-By: I95a0d5f1b7aef985df5625cd83222799db811f2b
    Change-Id: If7c22bc8a95fa13e746c86a1e9d4a6fa25496e1f