neutron-vpn-portip-port-data d.s not cleared 02/75402/11
authornithi thomas <nithi.t@altencalsoftlabs.com>
Thu, 23 Aug 2018 06:16:49 +0000 (11:46 +0530)
committerSam Hague <shague@redhat.com>
Mon, 17 Sep 2018 00:18:03 +0000 (00:18 +0000)
Issue:
======
Stale entry not removed for neutron-vpn-portip-port-data .
neutron-vpn-portip-port-data d.s has ODL based dhcp-port entry which is
not getting cleared after router is attached to BGP-VPN and then all the
configs are deleted.

Analysis:
=========
   The root-cause is all the retrieval of port list is done from
subnet-map. Dhcp port with device_id as ODL is wrongly getting added to
one of the subnet map in case of dual-stack. For eg, in case of
dual-stack if we create ipv4 subnet first the corresponding add() for
the port will be invoked and the check for blocking ODL_based dhcp port
is available. Then if we are creating ipv6 subnet corresponding update()
for the port is invoked where this check was missed out and that is why
ipv6 subnet map will have ODL based dhcp port entry in the port-list.
             All the looping for ip's is done thru subnetmap port list
where wrongly added ODL dhcp port also get's added. Added check in
update() to block dhcp interfaces with device_id as ODL.

Issue: NETVIRT-1406

Change-Id: Idaf6f43525655c4043f5cee7b32263cd9858e31c
Signed-off-by: nithi thomas <nithi.t@altencalsoftlabs.com>
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronPortChangeListener.java

index 38113ad0ab4f1431c14f364d699907bcf9f8c629..13fbb7fea781477fa1a7320fe930f7e6ac300fe2 100644 (file)
@@ -724,6 +724,11 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
                       + "during subnet deletion event.", portupdate.getUuid().getValue());
             return;
         }
+
+        if (NeutronConstants.IS_ODL_DHCP_PORT.test(portupdate)) {
+            return;
+        }
+
         jobCoordinator.enqueueJob("PORT- " + portupdate.getUuid().getValue(),
             () -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, confTx -> {
                 final List<Uuid> originalSnMapsIds = portoriginalIps.stream().map(FixedIps::getSubnetId)