[OVN] Revision number registers must be filtered by resource ID and type

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

Bug Description

The OVN revision numbers have a multicolumn index: (resource_uuid, resource_type) [1]. In particular because of the Neutron ports that belong to a router. A router interface is a single Neutron register ("ports"). But in OVN two registers are created: "Logical_Switch_Ports" and "Logical_Router_Ports".

When retrieving a register "ovn_revision_numbers" from the Neutron database, it is needed to provide both the resource_uuid and the resource_type [2].

[1]https://github.com/openstack/neutron/blob/febdfb5d8b1cf261c13b40e330d91a5bcb6c7642/neutron/db/models/ovn.py#L41-L46
[2]https://github.com/openstack/neutron/blob/febdfb5d8b1cf261c13b40e330d91a5bcb6c7642/neutron/db/ovn_revision_numbers_db.py#L159-L167

Tags: ovn
Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
importance: Undecided → High
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Any patch fixing this issue should be backported up to the oldest active branch (2023.1 right now).

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

Changed in neutron:
status: New → In Progress
tags: added: ovn
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/2024.2)

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

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

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

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

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

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

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

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

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

commit a298a37fe7ee41d25db02fdde36e134b01ef5d9a
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Oct 30 00:58:16 2024 +0000

    [OVN] Fix the revision number retrieval method

    The "ovn_revision_numbers" table has a unique constraint that is a
    combination of the "resource_uuid" and the "resource_type". There is
    a case where the resource_uuid can be the same for two registers.
    A router interface will create a single Neutron DB register ("ports")
    but it will require two OVN DB registers ("Logical_Switch_Port" and
    "Logical_Router_Ports"). In this case is needed to define the
    "resource_type" when retrieving the revision number.

    The exception "RevisionNumberNotDefined" will be thrown if only the
    "resource_uuid" is provided in the related case.

    Closes-Bug: #2085946
    Change-Id: I12079de78773f7409503392d4791848aea90cb7b

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/934024
Committed: https://opendev.org/openstack/neutron/commit/2d376a76c9298ce225c9dc49c16e6fd92aca55cd
Submitter: "Zuul (22348)"
Branch: stable/2024.1

commit 2d376a76c9298ce225c9dc49c16e6fd92aca55cd
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Oct 30 00:58:16 2024 +0000

    [OVN] Fix the revision number retrieval method

    The "ovn_revision_numbers" table has a unique constraint that is a
    combination of the "resource_uuid" and the "resource_type". There is
    a case where the resource_uuid can be the same for two registers.
    A router interface will create a single Neutron DB register ("ports")
    but it will require two OVN DB registers ("Logical_Switch_Port" and
    "Logical_Router_Ports"). In this case is needed to define the
    "resource_type" when retrieving the revision number.

    The exception "RevisionNumberNotDefined" will be thrown if only the
    "resource_uuid" is provided in the related case.

    Closes-Bug: #2085946
    Change-Id: I12079de78773f7409503392d4791848aea90cb7b
    (cherry picked from commit a298a37fe7ee41d25db02fdde36e134b01ef5d9a)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/934025
Committed: https://opendev.org/openstack/neutron/commit/de11a56f5ada9a6695cff2c63803f2c80230fc19
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit de11a56f5ada9a6695cff2c63803f2c80230fc19
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Oct 30 00:58:16 2024 +0000

    [OVN] Fix the revision number retrieval method

    The "ovn_revision_numbers" table has a unique constraint that is a
    combination of the "resource_uuid" and the "resource_type". There is
    a case where the resource_uuid can be the same for two registers.
    A router interface will create a single Neutron DB register ("ports")
    but it will require two OVN DB registers ("Logical_Switch_Port" and
    "Logical_Router_Ports"). In this case is needed to define the
    "resource_type" when retrieving the revision number.

    The exception "RevisionNumberNotDefined" will be thrown if only the
    "resource_uuid" is provided in the related case.

    Closes-Bug: #2085946
    Change-Id: I12079de78773f7409503392d4791848aea90cb7b
    (cherry picked from commit a298a37fe7ee41d25db02fdde36e134b01ef5d9a)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/934026
Committed: https://opendev.org/openstack/neutron/commit/989892ea13817f8a5bfbc3e6f053643f21fd02c7
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 989892ea13817f8a5bfbc3e6f053643f21fd02c7
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Oct 30 00:58:16 2024 +0000

    [OVN] Fix the revision number retrieval method

    The "ovn_revision_numbers" table has a unique constraint that is a
    combination of the "resource_uuid" and the "resource_type". There is
    a case where the resource_uuid can be the same for two registers.
    A router interface will create a single Neutron DB register ("ports")
    but it will require two OVN DB registers ("Logical_Switch_Port" and
    "Logical_Router_Ports"). In this case is needed to define the
    "resource_type" when retrieving the revision number.

    The exception "RevisionNumberNotDefined" will be thrown if only the
    "resource_uuid" is provided in the related case.

    Closes-Bug: #2085946
    Change-Id: I12079de78773f7409503392d4791848aea90cb7b
    (cherry picked from commit a298a37fe7ee41d25db02fdde36e134b01ef5d9a)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/934023
Committed: https://opendev.org/openstack/neutron/commit/245d8266d52fb213e527c97c458d41159c578117
Submitter: "Zuul (22348)"
Branch: stable/2024.2

commit 245d8266d52fb213e527c97c458d41159c578117
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Oct 30 00:58:16 2024 +0000

    [OVN] Fix the revision number retrieval method

    The "ovn_revision_numbers" table has a unique constraint that is a
    combination of the "resource_uuid" and the "resource_type". There is
    a case where the resource_uuid can be the same for two registers.
    A router interface will create a single Neutron DB register ("ports")
    but it will require two OVN DB registers ("Logical_Switch_Port" and
    "Logical_Router_Ports"). In this case is needed to define the
    "resource_type" when retrieving the revision number.

    The exception "RevisionNumberNotDefined" will be thrown if only the
    "resource_uuid" is provided in the related case.

    Closes-Bug: #2085946
    Change-Id: I12079de78773f7409503392d4791848aea90cb7b
    (cherry picked from commit a298a37fe7ee41d25db02fdde36e134b01ef5d9a)

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

This issue was fixed in the openstack/neutron 26.0.0.0b1 development milestone.

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

This issue was fixed in the openstack/neutron 2023.1-eom release.

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

This issue was fixed in the openstack/neutron 23.3.0 Bobcat release.

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

This issue was fixed in the openstack/neutron 25.1.0 Dalmatian release.

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

This issue was fixed in the openstack/neutron 24.1.0 Caracal 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.