]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Revert "Remove port from ovsdb after its deletion"
authorarmando-migliaccio <armamig@gmail.com>
Fri, 27 Feb 2015 18:08:56 +0000 (10:08 -0800)
committerKyle Mestery <mestery@mestery.com>
Fri, 27 Feb 2015 20:47:42 +0000 (20:47 +0000)
Sentinel patch to establish whether commit [1] is at
fault of the sudden spike of DBDeadlock errors.

[1] d6a55c17360d1aa8ca91849199987ae71e8600ee

Change-Id: I021e94e322f9b5eca665ea3aede41e034d3047cc
Closed-Bug: #1426543

neutron/plugins/ml2/plugin.py
neutron/plugins/ml2/rpc.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/ml2/test_rpcapi.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py

index ab26528a9c526e554228138592fcd21865b6c161..d490bd09ae6a1f28112fe803837c6ce1dc077234 100644 (file)
@@ -1188,7 +1188,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
             # fact that an error occurred.
             LOG.error(_LE("mechanism_manager.delete_port_postcommit failed for"
                           " port %s"), id)
-        self.notifier.port_delete(context, id)
         self.notify_security_groups_member_updated(context, port)
 
     def get_bound_port_context(self, plugin_context, port_id, host=None):
index 22603b7ea948a02e84502e0ab3d11fb6e3512566..c92e5474046924e811d1a660544d222b0d3fb6bb 100644 (file)
@@ -199,10 +199,6 @@ class AgentNotifierApi(dvr_rpc.DVRAgentRpcApiMixin,
         self.topic_port_update = topics.get_topic_name(topic,
                                                        topics.PORT,
                                                        topics.UPDATE)
-        self.topic_port_delete = topics.get_topic_name(topic,
-                                                       topics.PORT,
-                                                       topics.DELETE)
-
         target = oslo_messaging.Target(topic=topic, version='1.0')
         self.client = n_rpc.get_client(target)
 
@@ -218,8 +214,3 @@ class AgentNotifierApi(dvr_rpc.DVRAgentRpcApiMixin,
         cctxt.cast(context, 'port_update', port=port,
                    network_type=network_type, segmentation_id=segmentation_id,
                    physical_network=physical_network)
-
-    def port_delete(self, context, port_id):
-        cctxt = self.client.prepare(topic=self.topic_port_delete,
-                                    fanout=True)
-        cctxt.cast(context, 'port_delete', port_id=port_id)
index 33847f534ac87ce72de8a6a75e1a37bec920d8f2..a500187ba18b4a2819489d8071d353d39e249f40 100644 (file)
@@ -292,7 +292,6 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
         self.endpoints = [self]
         # Define the listening consumers for the agent
         consumers = [[topics.PORT, topics.UPDATE],
-                     [topics.PORT, topics.DELETE],
                      [topics.NETWORK, topics.DELETE],
                      [constants.TUNNEL, topics.UPDATE],
                      [constants.TUNNEL, topics.DELETE],
@@ -331,13 +330,6 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
         self.updated_ports.add(port['id'])
         LOG.debug("port_update message processed for port %s", port['id'])
 
-    def port_delete(self, context, **kwargs):
-        port_id = kwargs.get('port_id')
-        port = self.int_br.get_vif_port_by_id(port_id)
-        # If port exists, delete it
-        if port:
-            self.int_br.delete_port(port.port_name)
-
     def tunnel_update(self, context, **kwargs):
         LOG.debug("tunnel_update received")
         if not self.enable_tunneling:
index 0a4c0453f5b2ce0009674f02a3ac630db1de3a87..efb1dbd57847f65747feb108b2df5f239ae0e51d 100644 (file)
@@ -227,16 +227,6 @@ class RpcApiTestCase(base.BaseTestCase):
                 segmentation_id='fake_segmentation_id',
                 physical_network='fake_physical_network')
 
-    def test_port_delete(self):
-        rpcapi = plugin_rpc.AgentNotifierApi(topics.AGENT)
-        self._test_rpc_api(
-            rpcapi,
-            topics.get_topic_name(topics.AGENT,
-                                  topics.PORT,
-                                  topics.DELETE),
-            'port_delete', rpc_method='cast',
-            fanout=True, port_id='fake_port')
-
     def test_tunnel_update(self):
         rpcapi = plugin_rpc.AgentNotifierApi(topics.AGENT)
         self._test_rpc_api(
index 861411b6b338c4c809741ed3d77c3e51fd1c3dcb..e97f2419543d2e00f32c734d68f315563dfea149 100644 (file)
@@ -498,20 +498,6 @@ class TestOvsNeutronAgent(base.BaseTestCase):
                                physical_network="physnet")
         self.assertEqual(set(['123']), self.agent.updated_ports)
 
-    def test_port_delete(self):
-        port_id = "123"
-        port_name = "foo"
-        with contextlib.nested(
-            mock.patch.object(self.agent.int_br, 'get_vif_port_by_id',
-                              return_value=mock.MagicMock(
-                                      port_name=port_name)),
-            mock.patch.object(self.agent.int_br, "delete_port")
-        ) as (get_vif_func, del_port_func):
-            self.agent.port_delete("unused_context",
-                                   port_id=port_id)
-            self.assertTrue(get_vif_func.called)
-            del_port_func.assert_called_once_with(port_name)
-
     def test_setup_physical_bridges(self):
         with contextlib.nested(
             mock.patch.object(ip_lib, "device_exists"),