Removing redundant extra-route delete 46/83246/8
authorAmitesh Soni <amitesh.soni@ericsson.com>
Thu, 25 Jul 2019 09:00:52 +0000 (14:30 +0530)
committerAbhinav Gupta <abhinav.gupta@ericsson.com>
Thu, 21 Nov 2019 11:51:20 +0000 (11:51 +0000)
Removing redundant delete of extra-route
from delAdjFromVpnInterface method since
it is already being taken care by remove
and update of FIB.

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

index 07d172178bdcc681c728190edc601375c2896243..b9e38a564c6fb922c63f9866249f5159724275aa 100755 (executable)
@@ -2076,11 +2076,6 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                         for (Adjacency adjacency : adjacencies) {
                             if (Objects.equals(adjacency.getIpAddress(), adj.getIpAddress())) {
                                 String rd = adjacency.getVrfId();
-                                InstanceIdentifier<Adjacency> adjIdentifier = VpnUtil
-                                        .getVpnInterfaceOpDataEntryAdjacencyIdentifier(currVpnIntf.getName(),
-                                                currVpnIntf.getVpnInstanceName(), adj.getIpAddress());
-                                LOG.debug("delAdjFromVpnInterface: adjIdentifier {}", adjIdentifier);
-                                writeOperTxn.delete(adjIdentifier);
                                 if (adj.getNextHopIpList() != null) {
                                     for (String nh : adj.getNextHopIpList()) {
                                         deleteExtraRouteFromCurrentAndImportingVpns(
@@ -2114,11 +2109,15 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
     private void deleteExtraRouteFromCurrentAndImportingVpns(String vpnName, String destination, String nextHop,
                                     String rd, String intfName, TypedWriteTransaction<Configuration> writeConfigTxn,
                                     TypedWriteTransaction<Operational> writeOperTx) {
+        LOG.info("removing extra-route {} for nexthop {} in VPN {} intfName {} rd {}",
+                destination, nextHop, vpnName, intfName, rd);
         vpnManager.delExtraRoute(vpnName, destination, nextHop, rd, vpnName, intfName, writeConfigTxn, writeOperTx);
         List<VpnInstanceOpDataEntry> vpnsToImportRoute = vpnUtil.getVpnsImportingMyRoute(vpnName);
         for (VpnInstanceOpDataEntry vpn : vpnsToImportRoute) {
             String vpnRd = vpn.getVrfId();
             if (vpnRd != null) {
+                LOG.info("deleting extra-route {} for nexthop {} in VPN {} intfName {} vpnRd {}",
+                        destination, nextHop, vpnName, intfName, vpnRd);
                 vpnManager.delExtraRoute(vpnName, destination, nextHop, vpnRd, vpnName, intfName, writeConfigTxn,
                         writeOperTx);
             }
index 4519f199787d0555909a340d843eeff0065f3cec..234997f15a2b13f85233ecddf5ac1fddb3590387 100644 (file)
@@ -298,8 +298,9 @@ public class VpnManagerImpl implements IVpnManager {
         String vpnNamePrefixKey = VpnUtil.getVpnNamePrefixKey(vpnName, prefix);
         // FIXME: separate out to somehow?
         final ReentrantLock lock = JvmGlobalLocks.getLockForString(vpnNamePrefixKey);
-        lock.lock();
+        LOG.info("removing prefix {} for nexthop {} in VPN {} rd {}", prefix, nextHop, vpnName, extraRouteRd);
         try {
+            lock.lock();
             if (vpnUtil.removeOrUpdateDSForExtraRoute(vpnName, primaryRd, extraRouteRd, vpnInterfaceName, prefix,
                     nextHop, nextHopTunnelIp, operTx)) {
                 return;
index 605f67d53752063e75f484b1d284be224932ed86..492218577b304cbd86ee9702b7b983c03807a32e 100644 (file)
@@ -705,7 +705,7 @@ public final class VpnUtil {
                 MDSALUtil.syncDelete(dataBroker,
                         LogicalDatastoreType.CONFIGURATION, VpnExtraRouteHelper.getUsedRdsIdentifier(getVpnId(vpnName),
                                 prefix, nextHop));
-                LOG.debug("removeOrUpdateDSForExtraRoute: Removed vpn-to-extraroute with rd {} prefix {} nexthop {}",
+                LOG.info("removeOrUpdateDSForExtraRoute: Removed vpn-to-extraroute with rd {} prefix {} nexthop {}",
                         extraRouteRd, prefix, nextHop);
                 fibManager.refreshVrfEntry(primaryRd, prefix);
                 operTx.delete(VpnUtil.getVpnInterfaceOpDataEntryAdjacencyIdentifier(vpnInterfaceName, vpnName, prefix));