Prefix to interface d.s not cleared 80/74180/6
authornithi thomas <nithi.t@altencalsoftlabs.com>
Tue, 10 Jul 2018 10:01:00 +0000 (15:31 +0530)
committerSam Hague <shague@redhat.com>
Sat, 28 Jul 2018 11:58:42 +0000 (11:58 +0000)
Issue:
======
Stale flows not removed for many data stores .
Stale entries were not removed for prefix-to-interface d.s
because of which dependent vpn related d.s were not cleared.

Analysis:
=========
Prefix-to-interface was wrongly getting deleted from
removePrefixToInterfaceAdj() in updtae() in VpnInterfaceManager.java
because of which in cleanUpOpDataForFib() ,prefixinfo was null and the
respective calls to delete prefix-to-interface and vpn-interace-op-data
was getting missed.
         Removed the call removePrefixToInterfaceAdj().

Issue: NETVIRT-1223

Change-Id: Id892b033014606e6c451cb2c5644d839ec2da5ac
Signed-off-by: nithi thomas <nithi.t@altencalsoftlabs.com>
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceManager.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnUtil.java

index 8dbff5f3e0eb3cfd43bb4dbe9cbfd5119ba5de73..22b42d4f9794a9f5ddab2cade443fcc06b452ff0 100755 (executable)
@@ -1581,17 +1581,6 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                                                 && !adj.isPhysNetworkFunc()) {
                                             delAdjFromVpnInterface(vpnInterfaceOpIdentifier, adj, dpnId,
                                                     operTx, confTx);
-                                            Optional<VpnInterfaceOpDataEntry> optVpnInterface = operTx.read(
-                                                    LogicalDatastoreType.OPERATIONAL, vpnInterfaceOpIdentifier).get();
-                                            if (optVpnInterface.isPresent()) {
-                                                VpnInterfaceOpDataEntry vpnInterfaceOpDataEntry = optVpnInterface.get();
-                                                long vpnId = vpnUtil.getVpnId(newVpnName);
-                                                vpnUtil.removePrefixToInterfaceAdj(adj, vpnId,
-                                                        vpnInterfaceOpDataEntry, operTx);
-                                            } else {
-                                                LOG.info("update: Vpninterface {} not present in Operational",
-                                                        vpnInterfaceName);
-                                            }
                                             //remove FIB entry
                                             String vpnRd = vpnUtil.getVpnRd(newVpnName);
                                             LOG.debug("update: remove prefix {} from the FIB and BGP entry "
index 0e59f20b7d8cb17256cdeddc412c363f2c2c84d5..ab8e2d2f92673995895ca47de0e92e4e49d2582a 100644 (file)
@@ -2072,43 +2072,6 @@ public final class VpnUtil {
         return false;
     }
 
-    void removePrefixToInterfaceAdj(Adjacency adj, long vpnId, VpnInterfaceOpDataEntry vpnInterfaceOpDataEntry,
-                                    WriteTransaction writeOperTxn) {
-        if (writeOperTxn == null) {
-            ListenableFutures.addErrorLogging(
-                    txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
-                        removePrefixToInterfaceAdj(adj, vpnId, vpnInterfaceOpDataEntry, tx)), LOG,
-                    "Error removing prefix");
-            return;
-        }
-
-        Optional<Prefixes> prefix = read(LogicalDatastoreType.OPERATIONAL,
-                VpnUtil.getPrefixToInterfaceIdentifier(vpnId, VpnUtil.getIpPrefix(adj.getIpAddress())));
-        List<Prefixes> prefixToInterface = new ArrayList<>();
-        List<Prefixes> prefixToInterfaceLocal = new ArrayList<>();
-        if (prefix.isPresent()) {
-            prefixToInterfaceLocal.add(prefix.get());
-        }
-        if (prefixToInterfaceLocal.isEmpty()) {
-            for (String nh : adj.getNextHopIpList()) {
-                prefix = read(LogicalDatastoreType.OPERATIONAL, VpnUtil.getPrefixToInterfaceIdentifier(vpnId,
-                                VpnUtil.getIpPrefix(nh)));
-                if (prefix.isPresent()) {
-                    prefixToInterfaceLocal.add(prefix.get());
-                }
-            }
-        }
-        if (!prefixToInterfaceLocal.isEmpty()) {
-            prefixToInterface.addAll(prefixToInterfaceLocal);
-        }
-        for (Prefixes pref : prefixToInterface) {
-            if (VpnUtil.isMatchedPrefixToInterface(pref, vpnInterfaceOpDataEntry)) {
-                writeOperTxn.delete(LogicalDatastoreType.OPERATIONAL,
-                        VpnUtil.getPrefixToInterfaceIdentifier(vpnId, pref.getIpAddress()));
-            }
-        }
-    }
-
     public static void sendNeighborSolicationToOfGroup(Ipv6NdUtilService ipv6NdUtilService, Ipv6Address srcIpv6Address,
             MacAddress srcMac, Ipv6Address dstIpv6Address, Long ofGroupId, BigInteger dpId) {
         SendNeighborSolicitationToOfGroupInput input = new SendNeighborSolicitationToOfGroupInputBuilder()