CSIT L3VPN TC Failure FIX 06/86806/4
authorKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Wed, 8 Jan 2020 12:46:57 +0000 (18:16 +0530)
committerKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Thu, 9 Jan 2020 06:34:18 +0000 (06:34 +0000)
Issue: NETVIRT-1637

CSIT ISSUE:
============
L3VPN CSIT failure post MRI actviity

Exception Issue:
================
VpnInterfaceManager              | 370 -
org.opendaylight.netvirt.vpnmanager-impl - 0.10.0.SNAPSHOT | Failed to add
adjacency Adjacency{getAdjacencyType=LearntIp,
getIpAddress=192.168.10.110/32, getNextHopIpList=[10.10.10.10],
isPhysNetworkFunc=false, augmentation=[]} to vpn interface
b8ed74b7-21ad-4c1f-8cfa-3e9e8eb08a8e with dpnId 13255991979830',
u'java.lang.UnsupportedOperationException: null', u'\tat
com.google.common.collect.ImmutableCollection.removeAll(ImmutableCollection.java:283)
~[35:com.google.guava:27.1.0.jre]', u'\tat
org.opendaylight.netvirt.vpnmanager.VpnUtil
.allocateRdForExtraRouteAndUpdateUsedRdsMap(VpnUtil.java:1560)
~[?:?]',

CSIT Solution:
==============
As part of this fix we have properly handled the
vpn-interface-op-data cleanup for router to BGPVPN
swap case.

Since existing code it was not properly handled the validation for
vpn-interface-op-data clean-up. Hence when router-intstance
is associated/disassociated with BGPVPN corresponding
data store entries are not getting cleaned-up.

Exception Solution:
===================
As part of this fix we have done proper fix for UnsupportedOperation
Exception from VpnManager as well.

Signed-off-by: Karthikeyan Krishnan <karthikeyangceb007@gmail.com>
Change-Id: I57a0d774c8cf8bf381337729603523a70aa7cf4e

fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/VrfEntryListener.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnUtil.java

index d52e00069caa67dd179d59246299587c56b09bc1..013d5cbb622a3662e3bece1f84cf1339bb3d8c73 100644 (file)
@@ -1419,7 +1419,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                             .read(FibUtil.getVpnInterfaceOpDataEntryIdentifier(ifName, vpnName)).get();
                     if (opVpnInterface.isPresent()) {
                         Uint32 associatedVpnId = fibUtil.getVpnId(vpnName);
-                        if (Objects.equals(vpnId, associatedVpnId)) {
+                        if (!Objects.equals(vpnId, associatedVpnId)) {
                             LOG.warn("Prefixes {} are associated with different vpn instance with id {} rather than {}",
                                     vrfEntry.getDestPrefix(), associatedVpnId, vpnId);
                             LOG.warn("Not proceeding with Cleanup op data for prefix {}", vrfEntry.getDestPrefix());
index ab0109ab29f9fba1e696c63c861f943652f1cbc3..03b4e121ae75bd2cfc07efc65228e14548071866 100644 (file)
@@ -1557,7 +1557,9 @@ public final class VpnUtil {
         } else {
             LOG.trace("Removing used rds {} from available rds {} vpnid {} . prefix is {} , vpname- {}, dpnId- {}",
                     usedRds, availableRds, vpnId, prefix, vpnName, dpnId);
-            availableRds.removeAll(usedRds);
+            if (usedRds != null || !usedRds.isEmpty()) {
+                availableRds.removeAll(usedRds);
+            }
             if (availableRds.isEmpty()) {
                 LOG.error("No rd available from VpnInstance to allocate for prefix {}", prefix);
                 return java.util.Optional.empty();