From 2f4bb76338433f2d3afc10facadee95876b9a5b7 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 11 May 2020 12:09:46 +0200 Subject: [PATCH] Don't check if any bridges were recrected when OVS was restarted In case when openvswitch was restarted, full sync of all bridges will be always triggered by neutron-ovs-agent so there is no need to check in same rpc_loop iteration if bridges were recreated. Conflicts: neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py Change-Id: I3cc1f1b7dc480d54a7cee369e4638f9fd597c759 Related-bug: #1864822 (cherry picked from commit 45482e300aab781064281b3e06a17ae488831151) (cherry picked from commit b8e7886d8b52a144241c0cc2c30b670ce5ddf926) --- .../openvswitch/agent/ovs_neutron_agent.py | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py index f4ae94b003f..9e990b5ac24 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py @@ -2202,6 +2202,7 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin, LOG.info("Agent rpc_loop - iteration:%d started", self.iter_num) ovs_status = self.check_ovs_status() + bridges_recreated = False if ovs_status == constants.OVS_RESTARTED: self.setup_integration_br() self.setup_physical_bridges(self.bridge_mappings) @@ -2239,17 +2240,19 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin, port_stats = self.get_port_stats({}, {}) self.loop_count_and_wait(start, port_stats) continue - # Check if any physical bridge wasn't recreated recently - if bridges_monitor: - added_bridges = ( - bridges_monitor.bridges_added + self.added_bridges) - bridges_recreated = self._reconfigure_physical_bridges( - added_bridges) - if bridges_recreated: - # In case when any bridge was "re-created", we need to - # ensure that there is no any stale flows in bridges left - need_clean_stale_flow = True - sync |= bridges_recreated + else: + # Check if any physical bridge wasn't recreated recently + if bridges_monitor: + added_bridges = ( + bridges_monitor.bridges_added + self.added_bridges) + bridges_recreated = self._reconfigure_physical_bridges( + added_bridges) + if bridges_recreated: + # In case when any bridge was "re-created", we need to + # ensure that there is no any stale flows in bridges + # left + need_clean_stale_flow = True + sync |= bridges_recreated # Notify the plugin of tunnel IP if self.enable_tunneling and tunnel_sync: try: