Nova-delete is not working for ECMP UCs. 27/84027/3
authorAmitesh Soni <amitesh.soni@ericsson.com>
Wed, 28 Aug 2019 07:07:42 +0000 (12:37 +0530)
committerFaseela K <faseela.k@ericsson.com>
Fri, 13 Sep 2019 08:21:56 +0000 (08:21 +0000)
In ECMP, when router is associated with bgpvpn,
nova delete was not clearing up relevant DSs
(because of recent changes in MIP UC)

Correcting this logic where removeLearntPrefixFromBGP
is called only when adjacency is learnt IP.

Change-Id: Ie289378fcab8b5d6d69d825b9b9e708aabfb2e29
Signed-off-by: Amitesh Soni <amitesh.soni@ericsson.com>
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceManager.java

index 02eb7b86cf48f3691142725db0ab41fa9274ba8e..ee639f1cb3306dfcc150fd3eadfea01a8a9796bc 100755 (executable)
@@ -1389,7 +1389,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
             InstanceIdentifier<AdjacenciesOp> path = identifier.augmentation(AdjacenciesOp.class);
             Optional<AdjacenciesOp> adjacencies = SingleTransactionDataBroker.syncReadOptional(dataBroker,
                     LogicalDatastoreType.OPERATIONAL, path);
-            boolean isNonPrimaryAdjIp = Boolean.FALSE;
+            boolean isLearntIP = false;
             String primaryRd = vpnUtil.getVpnRd(vpnName);
             LOG.info("removeAdjacenciesFromVpn: For interface {} on dpn {} RD recovered for vpn {} as rd {}",
                     interfaceName, dpnId, vpnName, primaryRd);
@@ -1409,7 +1409,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                         List<String> nhList;
                         if (nextHop.getAdjacencyType() != AdjacencyType.PrimaryAdjacency) {
                             nhList = getNextHopForNonPrimaryAdjacency(nextHop, vpnName, dpnId, interfaceName);
-                            isNonPrimaryAdjIp = Boolean.TRUE;
+                            isLearntIP = nextHop.getAdjacencyType() == AdjacencyType.LearntIp ? true : false;
                         } else {
                             // This is a primary adjacency
                             nhList = nextHop.getNextHopIpList() != null ? nextHop.getNextHopIpList()
@@ -1444,7 +1444,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                                 vpnVipToPort.getPortName(), ip, dpnId, vpnName);
                     }
                     // Remove the MIP-IP from VpnPortIpToPort.
-                    if (isNonPrimaryAdjIp) {
+                    if (isLearntIP) {
                         VpnPortipToPort persistedIp = vpnUtil.getVpnPortipToPort(vpnName, ip);
                         if (persistedIp != null && persistedIp.isLearntIp()
                                 && persistedIp.getPortName().equals(interfaceName)) {