``OVNL3RouterPlugin._port_update`` can be called before the LRP is created in the OVN DB

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

Bug Description

``OVNL3RouterPlugin._port_update`` [1] is called AFTER_UPDATE the router port is created (for example, when a subnet is attached to a router). This event is guaranteed to be called after the Neutron DB has the resource (port) in the database. However, as the code highlights in the comment, this event can be called before the OVN NB database has the LRP resource created. The called method, ``update_router_port`` --> ``_update_router_port``, guarantees that the LRP update is executed only when the LRP exists but the LRP read [2] does not have this consideration.

This event should be replaced by an OVN DB event, checking the same conditions as in [1] and guaranteeing that the LRP resource is already created in the DB.

Example of this failure: https://zuul.opendev.org/t/openstack/build/3f7935d7ed53473898bbf213e85dfb61/log/controller/logs/dsvm-functional-logs/ovn_octavia_provider.tests.functional.test_driver.TestOvnOctaviaProviderDriver.test_create_lb_custom_network/testrun.txt

[1]https://opendev.org/openstack/neutron/src/commit/e8468a6dd647fd62eac429417c7f382e8859b574/neutron/services/ovn_l3/plugin.py#L372-L381
[2]https://opendev.org/openstack/neutron/src/commit/e8468a6dd647fd62eac429417c7f382e8859b574/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py#L1809-L1811

description: updated
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/912347

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/+/912349

Changed in neutron:
status: New → In Progress
Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

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

commit f82c650c8c1bfb0b4283b8624d8b6f32f1f8d188
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sun Mar 10 15:47:09 2024 +0000

    [OVN] Add the network type to the ``Logical_Switch`` register

    Now the ``Logical_Switch`` register (that represents an OVN network),
    stored the network type in the "external_ids" field.

    Related-Bug: #2056558
    Change-Id: I9e55a7412d841b7b59602c56c3a4e2f9c954aeed

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

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

commit 0fd654f5929fc6a4f3a36d6b9020d6622564128b
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sun Mar 10 17:20:39 2024 +0000

    [OVN] Use the LSP update event to update the LRP

    Now the "Logical_Router_Port" is updated when a "Logical_Switch_Port"
    event is received. When the event is received, it is first checked that
    the "Logical_Switch_Port" belongs to a router; if that check is
    possitive, the router port update method is called.

    Closes-Bug: #2056558
    Change-Id: I13b4c804ea6a9f8a89d3796c1cec88ffa1de6ded

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.