Bug 8552 - [l3vpn]Stale flow entries not getting removed even when all the 19/59019/3
authoreupakir <kiran.n.upadhyaya@ericsson.com>
Thu, 15 Jun 2017 12:04:16 +0000 (17:34 +0530)
committerSam Hague <shague@redhat.com>
Sat, 17 Jun 2017 01:22:19 +0000 (01:22 +0000)
VM config are deleted

FIB handling was being interrupted by and NPE, which led to stale remote
table-21 flows. This is because the GroupEntityBuilder has been modified
with respect to the way it adds BucketListInfo.
It tries to addALL the elements from the input List of buckets now, and
hence a null param causes NPE. This has been fixed.

Change-Id: Iafe20e405101c294ce56babbaf5ff0057be55ae7
Signed-off-by: eupakir <kiran.n.upadhyaya@ericsson.com>
vpnservice/fibmanager/fibmanager-impl/src/main/java/org/opendaylight/netvirt/fibmanager/NexthopManager.java
vpnservice/fibmanager/fibmanager-impl/src/main/java/org/opendaylight/netvirt/fibmanager/VrfEntryListener.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NaptSwitchHA.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NatTunnelInterfaceStateListener.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/RouterDpnChangeListener.java
vpnservice/policyservice/impl/src/main/java/org/opendaylight/netvirt/policyservice/util/PolicyServiceFlowUtil.java

index c3090e37615995a0f308fb542b317c82ff45a4e4..2be250d23f75f28d929111224cd9baa4b96c4ea6 100644 (file)
@@ -528,7 +528,8 @@ public class NexthopManager implements AutoCloseable {
                 int newFlowrefCnt = nh.getFlowrefCount() - 1;
                 if (newFlowrefCnt == 0) { //remove the group only if there are no more flows using this group
                     GroupEntity groupEntity = MDSALUtil.buildGroupEntity(
-                        dpnId, nh.getEgressPointer(), ipAddress, GroupTypes.GroupAll, null);
+                        dpnId, nh.getEgressPointer(), ipAddress, GroupTypes.GroupAll,
+                            Collections.EMPTY_LIST /*listBucketInfo*/);
                     // remove Group ...
                     mdsalApiManager.removeGroup(groupEntity);
                     //update MD-SAL DS
index e8b26f5cfa0101d51d0b41f47721ec0cb214c997..86d596f55c57ba232401352cd4b03f011648db4d 100755 (executable)
@@ -1033,7 +1033,8 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                             vpnId, rd, vrfEntry, isExtraroute);
                     if (!dpnId.equals(BigInteger.ZERO)) {
                         nextHopManager.setupLoadBalancingNextHop(vpnId, dpnId,
-                                vrfEntry.getDestPrefix(), /*listBucketInfo*/ null, /*remove*/ false);
+                                vrfEntry.getDestPrefix(), /*listBucketInfo*/ Collections.emptyList(),
+                                /*remove*/ false);
                         returnLocalDpnId.add(dpnId);
                     }
                 } else {
@@ -1701,7 +1702,8 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
         if (localDpnId != null && localDpnId != BigInteger.ZERO) {
             // localDpnId is not known when clean up happens for last vm for a vpn on a dpn
             if (extraRouteOptional.isPresent()) {
-                nextHopManager.setupLoadBalancingNextHop(vpnId, remoteDpnId, vrfEntry.getDestPrefix(), null , false);
+                nextHopManager.setupLoadBalancingNextHop(vpnId, remoteDpnId, vrfEntry.getDestPrefix(),
+                        Collections.emptyList() /*listBucketInfo*/, false);
             }
             deleteFibEntry(remoteDpnId, vpnId, vrfEntry, rd, tx);
             return;
index 3c5c911194909f581d6a6035c45b5ab051e67a6f..356a6fdcbddbfc4683a3f4179496b074b1aa6a71 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.netvirt.natservice.internal;
 import com.google.common.base.Optional;
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -473,7 +474,7 @@ public class NaptSwitchHA {
             GroupEntity groupEntity = null;
             try {
                 groupEntity = MDSALUtil.buildGroupEntity(naptSwitch, groupId, routerName,
-                        GroupTypes.GroupAll, null);
+                        GroupTypes.GroupAll, Collections.emptyList() /*listBucketInfo*/);
                 LOG.info("NAT Service : Removing NAPT Group in new naptSwitch {}", naptSwitch);
                 mdsalManager.removeGroup(groupEntity);
             } catch (Exception ex) {
index a88c6f17571a7ebbe12b6b185cfe12ffd3190509..bc4a3fbb9b09cf70c3173e361182588e2f88353f 100644 (file)
@@ -16,6 +16,7 @@ import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.Future;
@@ -270,7 +271,7 @@ public class NatTunnelInterfaceStateListener
                 GroupEntity groupEntity = null;
                 try {
                     groupEntity = MDSALUtil.buildGroupEntity(dpnId, groupId, routerName,
-                        GroupTypes.GroupAll, null);
+                        GroupTypes.GroupAll, Collections.emptyList() /*listBucketInfo*/);
                     LOG.info("NAT Service : SNAT -> Removing NAPT GroupEntity:{} on Dpn {}", groupEntity, dpnId);
                     mdsalManager.removeGroup(groupEntity);
                 } catch (Exception ex) {
index 834d5d739f737b1313bf34a172d73b1b5449b89b..62c188a00ce6ef43d32fb6e55cb17b2d4f85eba9 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.netvirt.natservice.internal;
 import com.google.common.base.Optional;
 
 import java.math.BigInteger;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import javax.annotation.PostConstruct;
@@ -395,7 +396,7 @@ public class RouterDpnChangeListener
                 GroupEntity groupEntity = null;
                 try {
                     groupEntity = MDSALUtil.buildGroupEntity(dpnId, groupId, routerName,
-                        GroupTypes.GroupAll, null);
+                        GroupTypes.GroupAll, Collections.emptyList() /*listBucketInfo*/);
                     LOG.info("NAT Service : Removing NAPT GroupEntity:{}", groupEntity);
                     mdsalManager.removeGroup(groupEntity);
                 } catch (Exception ex) {
index d173d26d1af995d380dfca2e466c022bec4ff9d5..032617ff8168cd3103120005e4c7335de8abdfdd 100644 (file)
@@ -130,7 +130,7 @@ public class PolicyServiceFlowUtil {
         }
 
         GroupEntity groupEntity = MDSALUtil.buildGroupEntity(dpId, groupId, groupName, groupType,
-                Collections.emptyList());
+                Collections.emptyList() /*listBucketInfo*/);
         if (addOrRemove == NwConstants.ADD_FLOW) {
             LOG.debug("Add group {} to DPN {}", groupId, dpId);
             mdsalManager.addGroupToTx(groupEntity, tx);