← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2110094] Re: OVN AgentCache get_agents method filters agents incorrectly if hostname overlaps

 

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

commit 26739f7c769a48f71c8590bbc481e1a11d8e793f
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date:   Mon May 12 12:45:20 2025 +0000

    [OVN] OVN agent retrieval filter matching improvement
    
    This patch improves the OVN agent retrieval method, adding a better
    filter matching algorithm:
    * If the filter field matches the agent field, then the values should
      match identically.
    * If the filter field is an iterator, then it is expected that at least
      one of the passed values in this iterator matches with the agent field
      value.
    
    Closes-Bug: #2110094
    Change-Id: Iaaf0bfdd485f62be7527bb0c48acc49527c6e9a1


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2110094

Title:
  OVN AgentCache get_agents method filters agents incorrectly if
  hostname overlaps

Status in neutron:
  Fix Released

Bug description:
  It was observed in a dcn environment where compute hostnames
  overlapped, like compute-0 and dcn1-compute-0, and the current code
  filters both of these host when any of these as passed as filter i.e
  host=dcn1-compute-0.

  Operation:- openstack port create --network dcn1-public --host
  dcn1-compute-0 port1

  Fails as:-
  2025-05-06 13:47:55.433 17 INFO neutron.plugins.ml2.drivers.ovn.mech_driver.mech_driver [None req-d4108c07-ba6a-467b-9b90-3d4d2a848fe3 376d4365073844daae419672441d3bc1 8d7a61145d2347b8ba7eb5f7c28cd4ae - - default default] Refusing to bind port 618b3861-f36e-4f37-8b24-83ba8bcff143 on host dcn1-compute-0 due to the OVN chassis bridge mapping physical networks ['datacentre'] not supporting physical network: leaf1
  2025-05-06 13:47:55.433 17 ERROR neutron.plugins.ml2.managers [None req-d4108c07-ba6a-467b-9b90-3d4d2a848fe3 376d4365073844daae419672441d3bc1 8d7a61145d2347b8ba7eb5f7c28cd4ae - - default default] Failed to bind port 618b3861-f36e-4f37-8b24-83ba8bcff143 on host dcn1-compute-0 for vnic_type normal using segments [{'id': 'c36c1b38-cee5-4d1a-ab68-3638e221695a', 'network_type': 'flat', 'physical_network': 'leaf1', 'segmentation_id': None, 'network_id': '4f35cb1c-69d7-4582-b3a5-0cf380c56f62'}]

  compute-0 - ovn-bridge-mappings=datacentre:br-ex
  dcn1-compute-0 - ovn-bridge-mappings=leaf1:br-ex

  Even the bridge mappings on dcn1-compute-0 is correct we can see the
  failure as it's not filtering correctly the hosts. This needs to be
  fixed.

  Current code is:-
  https://github.com/openstack/neutron/blob/123bd115f3b65ba09560685ad6cf68c6934a6535/neutron/plugins/ml2/drivers/ovn/agent/neutron_agent.py#L290C1-L298C26

      def get_agents(self, filters=None):
          filters = filters or {}
          agent_list = []
          for agent in self:
              agent_dict = agent.as_dict()
              if all(agent_dict[k] in v for k, v in filters.items()):
                  agent_list.append(agent)
          return agent_list 

  Originally reported at https://issues.redhat.com/browse/OSPRH-16439

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2110094/+subscriptions



References