OVN DB Sync always logs warning messages about updating all router ports

Bug #2030773 reported by Lucas Alvares Gomes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Fix Released
Undecided
Unassigned
Antelope
Triaged
Medium
Unassigned
Ussuri
Triaged
Medium
Unassigned
Victoria
Triaged
Medium
Unassigned
Wallaby
Triaged
Medium
Unassigned
Xena
Triaged
Medium
Unassigned
Yoga
Triaged
Medium
Unassigned
Zed
Triaged
Medium
Unassigned
neutron
Fix Released
Medium
Lucas Alvares Gomes
neutron (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Triaged
Medium
Unassigned
Jammy
Triaged
Medium
Unassigned
Lunar
Triaged
Medium
Unassigned

Bug Description

Reported at: https://bugzilla.redhat.com/show_bug.cgi?id=2225156

The ovn-db-sync script does not check if the router ports are actually out-of-sync before adding it to the list of ports that needs to be updated, this can create red herring problems by introducing an irrelevant piece of information [0] in the sync report (specially when ran in "log" mode) making the user think that the databases might be out-of-sync even when it is not.

Looking at the code [1] we can see that the comment talks about checking the networks and ipv6_ra_configs changes but it does neither; instead, it adds every router port to the list of ports that needs to be updated.

<snipet>

# We dont have to check for the networks and
# ipv6_ra_configs values. Lets add it to the
# update_lrport_list. If they are in sync, then
# update_router_port will be a no-op.
update_lrport_list.append(db_router_ports[lrport])

</snipet>

This LP is about changing this behavior and checking for such differences in the router ports before marking them to be updated.

[0]
2023-07-24 11:46:31.391 952358 WARNING networking_ovn.ovn_db_sync [req-1081a8a6-82dd-431c-a2ab-f58741dc1677 - - - - -] Router Port port_id=f164c0f1-8ac8-4c45-bba9-8c723a30c701 needs to be updated for networks changed

[1]
https://github.com/openstack/neutron/blob/c453813d0664259c4da0d132f224be2eebe70072/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py#L553-L557

===== Ubuntu SRU Details =====

[Impact]
See bug description above.

[Test Case]
Deploy openstack with OVN and multiple routers. Run the ovn-db-sync script and ensure router ports that are not out of sync are not marked to be updated.

[Where problems could occur]
If the _is_router_port_changed() function had a bug there would be potential for ports to be filtered out that need updating. Presumably this is not the case, but that is a theoritical potential for where problems could occur. All of these patches have already landed in the corresponding upstream branches.

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

Changed in neutron:
status: Confirmed → 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/+/890799
Committed: https://opendev.org/openstack/neutron/commit/4693836a1b58b477298e51cb47622222e3556752
Submitter: "Zuul (22348)"
Branch: master

commit 4693836a1b58b477298e51cb47622222e3556752
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 8 15:17:40 2023 +0100

    [OVN] ovn-db-sync check for router port differences

    Prior to this patch the ovn-db-sync script did not check if the router
    ports were actually out-of-sync before marking them to be updated. This
    behavior introduced irrelevant information in the sync report (specially
    when ran in "log" mode) making the user think that the databases were
    out-of-sync even when they were not.

    This patch adds the code checking for differences in the Neutron Router
    Ports and OVN Logical Router Port entries prior to updating them.

    Change-Id: Id7bf5a6aa547795ba78724eed59ba9d4fb74f758
    Closes-Bug: #2030773
    Signed-off-by: Lucas Alvares Gomes <email address hidden>

Changed in neutron:
status: In Progress → Fix Released
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/+/891501

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

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

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

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

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

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

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

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

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

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/+/891501
Committed: https://opendev.org/openstack/neutron/commit/04541b07209ce56fdd7dd052eae458e11666d9c0
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 04541b07209ce56fdd7dd052eae458e11666d9c0
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 8 15:17:40 2023 +0100

    [OVN] ovn-db-sync check for router port differences

    Prior to this patch the ovn-db-sync script did not check if the router
    ports were actually out-of-sync before marking them to be updated. This
    behavior introduced irrelevant information in the sync report (specially
    when ran in "log" mode) making the user think that the databases were
    out-of-sync even when they were not.

    This patch adds the code checking for differences in the Neutron Router
    Ports and OVN Logical Router Port entries prior to updating them.

    Conflicts:
      neutron/tests/unit/fake_resources.py

    Change-Id: Id7bf5a6aa547795ba78724eed59ba9d4fb74f758
    Closes-Bug: #2030773
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 4693836a1b58b477298e51cb47622222e3556752)

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

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

commit bc71377ba7f8c99910565969a462c3bd5b8b4379
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 8 15:17:40 2023 +0100

    [OVN] ovn-db-sync check for router port differences

    Prior to this patch the ovn-db-sync script did not check if the router
    ports were actually out-of-sync before marking them to be updated. This
    behavior introduced irrelevant information in the sync report (specially
    when ran in "log" mode) making the user think that the databases were
    out-of-sync even when they were not.

    This patch adds the code checking for differences in the Neutron Router
    Ports and OVN Logical Router Port entries prior to updating them.

    Conflicts:
      neutron/tests/unit/fake_resources.py

    Change-Id: Id7bf5a6aa547795ba78724eed59ba9d4fb74f758
    Closes-Bug: #2030773
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 4693836a1b58b477298e51cb47622222e3556752)

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/+/891503
Committed: https://opendev.org/openstack/neutron/commit/b288a1264a07d9590f2280d3cd7476b8117b94b2
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit b288a1264a07d9590f2280d3cd7476b8117b94b2
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 8 15:17:40 2023 +0100

    [OVN] ovn-db-sync check for router port differences

    Prior to this patch the ovn-db-sync script did not check if the router
    ports were actually out-of-sync before marking them to be updated. This
    behavior introduced irrelevant information in the sync report (specially
    when ran in "log" mode) making the user think that the databases were
    out-of-sync even when they were not.

    This patch adds the code checking for differences in the Neutron Router
    Ports and OVN Logical Router Port entries prior to updating them.

    Conflicts:
      neutron/tests/unit/fake_resources.py

    Change-Id: Id7bf5a6aa547795ba78724eed59ba9d4fb74f758
    Closes-Bug: #2030773
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 4693836a1b58b477298e51cb47622222e3556752)

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/+/891504
Committed: https://opendev.org/openstack/neutron/commit/518751eed355846ee74015d86b08e626928bb962
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 518751eed355846ee74015d86b08e626928bb962
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 8 15:17:40 2023 +0100

    [OVN] ovn-db-sync check for router port differences

    Prior to this patch the ovn-db-sync script did not check if the router
    ports were actually out-of-sync before marking them to be updated. This
    behavior introduced irrelevant information in the sync report (specially
    when ran in "log" mode) making the user think that the databases were
    out-of-sync even when they were not.

    This patch adds the code checking for differences in the Neutron Router
    Ports and OVN Logical Router Port entries prior to updating them.

    NOTE FOR THIS BACKPORT:

    The lrp_get() method from ovsdbapp is not present for this stable
    branch, so this patch was adapted to use the get_lrouter_port()
    instead.

    Conflicts:
      neutron/tests/unit/fake_resources.py

    Change-Id: Id7bf5a6aa547795ba78724eed59ba9d4fb74f758
    Closes-Bug: #2030773
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 4693836a1b58b477298e51cb47622222e3556752)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/891506
Committed: https://opendev.org/openstack/neutron/commit/1d2a8a679637a72b8171cd276c009766242e14c6
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 1d2a8a679637a72b8171cd276c009766242e14c6
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 8 15:17:40 2023 +0100

    [OVN] ovn-db-sync check for router port differences

    Prior to this patch the ovn-db-sync script did not check if the router
    ports were actually out-of-sync before marking them to be updated. This
    behavior introduced irrelevant information in the sync report (specially
    when ran in "log" mode) making the user think that the databases were
    out-of-sync even when they were not.

    This patch adds the code checking for differences in the Neutron Router
    Ports and OVN Logical Router Port entries prior to updating them.

    NOTE FOR THIS BACKPORT:

    The lrp_get() method from ovsdbapp is not present for this stable
    branch, so this patch was adapted to use the get_lrouter_port()
    instead.

    Conflicts:
      neutron/tests/unit/fake_resources.py

    Change-Id: Id7bf5a6aa547795ba78724eed59ba9d4fb74f758
    Closes-Bug: #2030773
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 4693836a1b58b477298e51cb47622222e3556752)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/892182
Committed: https://opendev.org/openstack/neutron/commit/8d45ee7f34f339c683c03f5391800b9848aaf11e
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 8d45ee7f34f339c683c03f5391800b9848aaf11e
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 8 15:17:40 2023 +0100

    [OVN] ovn-db-sync check for router port differences

    Prior to this patch the ovn-db-sync script did not check if the router
    ports were actually out-of-sync before marking them to be updated. This
    behavior introduced irrelevant information in the sync report (specially
    when ran in "log" mode) making the user think that the databases were
    out-of-sync even when they were not.

    This patch adds the code checking for differences in the Neutron Router
    Ports and OVN Logical Router Port entries prior to updating them.

    NOTE FOR THIS BACKPORT:

    The lrp_get() method from ovsdbapp is not present for this stable
    branch, so this patch was adapted to use the get_lrouter_port()
    instead.

    Conflicts:
      neutron/tests/unit/fake_resources.py

    Change-Id: Id7bf5a6aa547795ba78724eed59ba9d4fb74f758
    Closes-Bug: #2030773
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 4693836a1b58b477298e51cb47622222e3556752)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/892183
Committed: https://opendev.org/openstack/neutron/commit/6af6771deb66b75f0189733771e9cc288d6139ed
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 6af6771deb66b75f0189733771e9cc288d6139ed
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Aug 8 15:17:40 2023 +0100

    [OVN] ovn-db-sync check for router port differences

    Prior to this patch the ovn-db-sync script did not check if the router
    ports were actually out-of-sync before marking them to be updated. This
    behavior introduced irrelevant information in the sync report (specially
    when ran in "log" mode) making the user think that the databases were
    out-of-sync even when they were not.

    This patch adds the code checking for differences in the Neutron Router
    Ports and OVN Logical Router Port entries prior to updating them.

    NOTE FOR THIS BACKPORT:

    The lrp_get() method from ovsdbapp is not present for this stable
    branch, so this patch was adapted to use the get_lrouter_port()
    instead.

    Conflicts:
      neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py
      neutron/tests/unit/fake_resources.py

    Change-Id: Id7bf5a6aa547795ba78724eed59ba9d4fb74f758
    Closes-Bug: #2030773
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 4693836a1b58b477298e51cb47622222e3556752)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 23.0.0.0b3

This issue was fixed in the openstack/neutron 23.0.0.0b3 development milestone.

Changed in neutron (Ubuntu):
status: New → Fix Released
Changed in neutron (Ubuntu Lunar):
status: New → Triaged
importance: Undecided → Medium
Changed in neutron (Ubuntu Jammy):
status: New → Triaged
importance: Undecided → Medium
Changed in cloud-archive:
status: New → Fix Released
Changed in neutron (Ubuntu Focal):
importance: Undecided → Medium
status: New → Triaged
description: updated
description: updated
description: updated
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.