[OVN] OvnSbSynchronizer - clean/delete segmenthostmappings for unrelated hosts

Bug #2040172 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Harald Jensås

Bug Description

neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.ovn_db_sync.OvnSbSynchronizer

When the `sync_hostname_and_physical_networks` method run's it will compare host physical_networks to mappings in neutrons `segmenthostmappings` table. Any mappings in neutron that is not seen on OVN chassis is then treated as "stale" and cleaned up.

This is problematic when there are other plug-ins/agents involved, for example ML2 networking-baremetal[2]. Any segment-host mapping created for baremetal nodes are deleted from the database. And since there is de-duplication[1] on updates from agents - the segment-host mappings are not re-created unless services are re-started or the baremetal node is deleted and re-created in the ironic service.

The OvnSbSynchronizer should not remove mappings unless they belong to OVN hosts.

[1] https://opendev.org/openstack/neutron/commit/176503e610aee16cb5799a77466579bc55129450
[2] https://opendev.org/openstack/networking-baremetal/src/branch/master/networking_baremetal/agent/ironic_neutron_agent.py

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

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

tags: added: ovn
Miguel Lavalle (minsel)
Changed in neutron:
importance: Undecided → High
assignee: nobody → Harald Jensås (harald-jensas)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 64b5787c3283b29cd36dde46ae298ae332f972d5
Author: Harald Jensås <email address hidden>
Date: Tue Oct 24 09:38:33 2023 +0200

    get_hosts_mapped_with_segments add filter agt_type

    Extend the get_hosts_mapped_with_segments method to add
    optional filters to include/exclude based on agent type.
    Uses a joined query, when both include and exclude
    filtering is used togheter the exclude filter is most
    significant.

    Partial-Bug: #2040172

    Change-Id: I2cfd52a2657fad989e24e974fda470ecd960262b
    Signed-off-by: Harald Jensås <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit 3aafeefc8553fd637bad238ee236b1767d8548ea
Author: Harald Jensås <email address hidden>
Date: Mon Oct 23 17:29:00 2023 +0200

    [OVN] DB sync host/physnet - filter on agent_type

    When syncing hostname and physical networks, filter neutron
    hosts on agent_type. Only segmenthostmappings for hosts
    with agent 'OVN Controller agent' should be cleaned up.

    Since change: I935186b6ee95f0cae8dc05869d9742c8fb3353c3 there
    is de-duplication of segmenthostmapping updates from agents.
    If the OVN DB sync clears/deletes mappings for hosts owned by
    other agents/plugins the mappings are never re-created.

    Closes-Bug: #2040172

    Change-Id: Iaf15e560e1b1ec31618b2ebc6206a938463c1094
    Signed-off-by: Harald Jensås <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.2)

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

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

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

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

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

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

commit d235f6551690a091f8452051f8f0feaff0217325
Author: Harald Jensås <email address hidden>
Date: Tue Oct 24 09:38:33 2023 +0200

    get_hosts_mapped_with_segments add filter agt_type

    Extend the get_hosts_mapped_with_segments method to add
    optional filters to include/exclude based on agent type.
    Uses a joined query, when both include and exclude
    filtering is used togheter the exclude filter is most
    significant.

    Partial-Bug: #2040172

    Change-Id: I2cfd52a2657fad989e24e974fda470ecd960262b
    Signed-off-by: Harald Jensås <email address hidden>
    (cherry picked from commit 64b5787c3283b29cd36dde46ae298ae332f972d5)

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/+/901788
Committed: https://opendev.org/openstack/neutron/commit/242508cd4bbb6fa2ec75a8ba4bd3f55cac6abb39
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 242508cd4bbb6fa2ec75a8ba4bd3f55cac6abb39
Author: Harald Jensås <email address hidden>
Date: Tue Oct 24 09:38:33 2023 +0200

    get_hosts_mapped_with_segments add filter agt_type

    Extend the get_hosts_mapped_with_segments method to add
    optional filters to include/exclude based on agent type.
    Uses a joined query, when both include and exclude
    filtering is used togheter the exclude filter is most
    significant.

    Partial-Bug: #2040172

    Change-Id: I2cfd52a2657fad989e24e974fda470ecd960262b
    Signed-off-by: Harald Jensås <email address hidden>
    (cherry picked from commit 64b5787c3283b29cd36dde46ae298ae332f972d5)

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

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

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

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

commit 9d22276013b61586cf4aca555e09487ef30eb064
Author: Harald Jensås <email address hidden>
Date: Tue Oct 24 09:38:33 2023 +0200

    get_hosts_mapped_with_segments add filter agt_type

    Extend the get_hosts_mapped_with_segments method to add
    optional filters to include/exclude based on agent type.
    Uses a joined query, when both include and exclude
    filtering is used togheter the exclude filter is most
    significant.

    Partial-Bug: #2040172

    Change-Id: I2cfd52a2657fad989e24e974fda470ecd960262b
    Signed-off-by: Harald Jensås <email address hidden>
    (cherry picked from commit 64b5787c3283b29cd36dde46ae298ae332f972d5)

tags: added: in-stable-zed
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/+/903685

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

commit de248d2826ec7b82c98a976c0e5da848e11ee167
Author: Harald Jensås <email address hidden>
Date: Mon Oct 23 17:29:00 2023 +0200

    [OVN] DB sync host/physnet - filter on agent_type

    When syncing hostname and physical networks, filter neutron
    hosts on agent_type. Only segmenthostmappings for hosts
    with agent 'OVN Controller agent' should be cleaned up.

    Since change: I935186b6ee95f0cae8dc05869d9742c8fb3353c3 there
    is de-duplication of segmenthostmapping updates from agents.
    If the OVN DB sync clears/deletes mappings for hosts owned by
    other agents/plugins the mappings are never re-created.

    Closes-Bug: #2040172

    Change-Id: Iaf15e560e1b1ec31618b2ebc6206a938463c1094
    Signed-off-by: Harald Jensås <email address hidden>
    (cherry picked from commit 71d69cf6277ba553354512209a2bff61c013f8ea)

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

commit 877e85e5a8b8668fc4baf7ee84b71225dadfa647
Author: Harald Jensås <email address hidden>
Date: Mon Oct 23 17:29:00 2023 +0200

    [OVN] DB sync host/physnet - filter on agent_type

    When syncing hostname and physical networks, filter neutron
    hosts on agent_type. Only segmenthostmappings for hosts
    with agent 'OVN Controller agent' should be cleaned up.

    Since change: I935186b6ee95f0cae8dc05869d9742c8fb3353c3 there
    is de-duplication of segmenthostmapping updates from agents.
    If the OVN DB sync clears/deletes mappings for hosts owned by
    other agents/plugins the mappings are never re-created.

    Closes-Bug: #2040172

    Change-Id: Iaf15e560e1b1ec31618b2ebc6206a938463c1094
    Signed-off-by: Harald Jensås <email address hidden>
    (cherry picked from commit 3aafeefc8553fd637bad238ee236b1767d8548ea)

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

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

commit 4eb234a4476761ca2581dba45655caceb21fc1ee
Author: Harald Jensås <email address hidden>
Date: Mon Oct 23 17:29:00 2023 +0200

    [OVN] DB sync host/physnet - filter on agent_type

    When syncing hostname and physical networks, filter neutron
    hosts on agent_type. Only segmenthostmappings for hosts
    with agent 'OVN Controller agent' should be cleaned up.

    Since change: I935186b6ee95f0cae8dc05869d9742c8fb3353c3 there
    is de-duplication of segmenthostmapping updates from agents.
    If the OVN DB sync clears/deletes mappings for hosts owned by
    other agents/plugins the mappings are never re-created.

    Closes-Bug: #2040172

    Change-Id: Iaf15e560e1b1ec31618b2ebc6206a938463c1094
    Signed-off-by: Harald Jensås <email address hidden>
    (cherry picked from commit 71d69cf6277ba553354512209a2bff61c013f8ea)

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

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

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

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

commit 6e3cbee84578eee3714659498ba334693b617f41
Author: Harald Jensås <email address hidden>
Date: Tue Oct 24 09:38:33 2023 +0200

    get_hosts_mapped_with_segments add filter agt_type

    Extend the get_hosts_mapped_with_segments method to add
    optional filters to include/exclude based on agent type.
    Uses a joined query, when both include and exclude
    filtering is used togheter the exclude filter is most
    significant.

    Partial-Bug: #2040172

    Change-Id: I2cfd52a2657fad989e24e974fda470ecd960262b
    Signed-off-by: Harald Jensås <email address hidden>
    (cherry picked from commit 64b5787c3283b29cd36dde46ae298ae332f972d5)

tags: added: in-stable-yoga
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/+/905913

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

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

commit 37abd72fed99525c302182d276d1c175f5d01a70
Author: Harald Jensås <email address hidden>
Date: Mon Oct 23 17:29:00 2023 +0200

    [OVN] DB sync host/physnet - filter on agent_type

    When syncing hostname and physical networks, filter neutron
    hosts on agent_type. Only segmenthostmappings for hosts
    with agent 'OVN Controller agent' should be cleaned up.

    Since change: I935186b6ee95f0cae8dc05869d9742c8fb3353c3 there
    is de-duplication of segmenthostmapping updates from agents.
    If the OVN DB sync clears/deletes mappings for hosts owned by
    other agents/plugins the mappings are never re-created.

    Closes-Bug: #2040172

    Change-Id: Iaf15e560e1b1ec31618b2ebc6206a938463c1094
    Signed-off-by: Harald Jensås <email address hidden>
    (cherry picked from commit 71d69cf6277ba553354512209a2bff61c013f8ea)
    (cherry picked from commit 4eb234a4476761ca2581dba45655caceb21fc1ee)

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

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

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

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

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/victoria)

Change abandoned by "Harald Jensås <email address hidden>" on branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/908215

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Harald Jensås <email address hidden>" on branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/908216

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/xena)

Change abandoned by "Harald Jensås <email address hidden>" on branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/908213
Reason: After discussion with neutron core Rodolfo, dropping backporting to these older stable branches.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Harald Jensås <email address hidden>" on branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/901792
Reason: After discussion with neutron core Rodolfo, dropping backporting to these older stable branches.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/wallaby)

Change abandoned by "Harald Jensås <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/908143
Reason: After discussion with neutron core Rodolfo, dropping backporting to these older stable branches.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Harald Jensås <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/908214
Reason: After discussion with neutron core Rodolfo, dropping backporting to these older stable branches.

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

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