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
.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());
} 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();