MPLS label for the def GW missing in the of-flows 27/83027/5
authorKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Fri, 12 Jul 2019 08:01:07 +0000 (13:31 +0530)
committerKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Fri, 26 Jul 2019 06:24:39 +0000 (06:24 +0000)
Issue:
=======
MPLS label for the default GW missing in the of-flows.

RCA:
====
populateFibOnNewDpn failing due to ITM failures as a result of
this ITM failure FIB Manager is unable to write the
default GW flow entry in the FRM DS.

Solution:
=========
Safeguarding populateFibOnDpn from other module failures.
Also a logger statement in FibUtil rethrows exceptions and
that could create issues for VPNEngine.

Enhanced existing logs inside nexthopmanager, so we know
for which vrfentry we flopped to add flows.

Change-Id: Ic1ee05111a84a34ce0fad237b08b8b091ca43f1e
Signed-off-by: Karthikeyan Krishnan <karthikeyangceb007@gmail.com>
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/BaseVrfEntryHandler.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/EvpnVrfEntryHandler.java
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/NexthopManager.java

index 1a6dc47e0d39dde4414da2fa20ba5b64aa04ebd2..a392b712be4276b4494a5d06197f72a504858c55 100644 (file)
@@ -468,7 +468,7 @@ public class BaseVrfEntryHandler implements AutoCloseable {
                 addRewriteDstMacAction(vpnId, vrfEntry, null, actionInfos);
             }
             List<ActionInfo> egressActions = nextHopManager.getEgressActionsForInterface(egressInterface,
-                    actionInfos.size(), true);
+                    actionInfos.size(), true, vpnId, vrfEntry.getDestPrefix());
             if (egressActions.isEmpty()) {
                 LOG.error(
                         "Failed to retrieve egress action for prefix {} route-paths {} interface {}. "
index 94a12dd45b5971e09143ebff570b5257cc57afcc..9e7cb385682eba33a515edd5beec210cea466e5a 100644 (file)
@@ -256,7 +256,7 @@ public class EvpnVrfEntryHandler extends BaseVrfEntryHandler {
             actionInfos.add(new ActionSetFieldTunnelId(tunnelId));
             List<ActionInfo> egressActions =
                     nexthopManager.getEgressActionsForInterface(adjacencyResult.getInterfaceName(), actionInfos.size(),
-                            true);
+                            true, vpnId, vrfEntry.getDestPrefix());
             if (egressActions.isEmpty()) {
                 LOG.error("Failed to retrieve egress action for prefix {} route-paths {} interface {}."
                         + " Aborting remote FIB entry creation..", vrfEntry.getDestPrefix(),
index 77d085012a9a58271a2a36138c7e1670fa55bfd2..29df7e2fe275e4854d278804b5975b2c3c328d94 100644 (file)
@@ -259,7 +259,8 @@ public class NexthopManager implements AutoCloseable {
     }
 
     protected List<ActionInfo> getEgressActionsForInterface(final String ifName, int actionKey,
-                                                            boolean isTunnelInterface) {
+                                                            boolean isTunnelInterface,
+                                                            long vpnId, String destIpPrefix) {
         List<Action> actions;
         try {
             if (isTunnelInterface && interfaceManager.isItmDirectTunnelsEnabled()) {
@@ -278,8 +279,8 @@ public class NexthopManager implements AutoCloseable {
                         .getEgressActionsForInterface(new GetEgressActionsForInterfaceInputBuilder()
                                 .setIntfName(ifName).build()).get();
                 if (!rpcResult.isSuccessful()) {
-                    LOG.error("RPC Call to Get egress vm actions for interface {} returned with Errors {}",
-                            ifName, rpcResult.getErrors());
+                    LOG.error("RPC Call to Get egress vm actions for interface {} vpnId {} ipPrefix {} returned with "
+                                    + "Errors {}", ifName, vpnId, destIpPrefix, rpcResult.getErrors());
                     return Collections.emptyList();
                 } else {
                     actions = rpcResult.getResult().nonnullAction();
@@ -313,8 +314,9 @@ public class NexthopManager implements AutoCloseable {
                 }
             }
             return listActionInfo;
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Exception when egress actions for interface {}", ifName, e);
+        } catch (InterruptedException | ExecutionException | NullPointerException e) {
+            LOG.error("Exception when egress actions for interface {} isTunnel {} vpnId {} ipPrefix {}", ifName,
+                    isTunnelInterface, vpnId, destIpPrefix, e);
         }
         LOG.warn("Exception when egress actions for interface {}", ifName);
         return Collections.emptyList();
@@ -361,7 +363,7 @@ public class NexthopManager implements AutoCloseable {
                 return rpcResult.getResult().getInterfaceName();
             }
         } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Exception when getting tunnel interface Id for tunnel between {} and  {}", srcDpId, dstIp, e);
+            LOG.error("Exception when getting tunnel interface Id for tunnel between {} and  {}", srcDpId, dstIp, e);
         }
         return null;
     }
@@ -411,7 +413,6 @@ public class NexthopManager implements AutoCloseable {
                     if (nexthop == null) {
                         String encMacAddress = macAddress == null
                                 ? fibUtil.getMacAddressFromPrefix(ifName, vpnName, primaryIpAddress) : macAddress;
-                        List<BucketInfo> listBucketInfo = new ArrayList<>();
                         List<ActionInfo> listActionInfo = new ArrayList<>();
                         int actionKey = 0;
                         // MAC re-write
@@ -429,8 +430,15 @@ public class NexthopManager implements AutoCloseable {
                             // FIXME: Log message here.
                             LOG.debug("mac address for new local nexthop is null");
                         }
-                        listActionInfo.addAll(getEgressActionsForInterface(ifName, actionKey, false));
+                        List<ActionInfo> nhActionInfoList = getEgressActionsForInterface(ifName, actionKey, false,
+                                vpnId, currDestIpPrefix);
+                        if (nhActionInfoList.isEmpty()) {
+                            LOG.error("createLocalNextHop: Skipping, Empty list of egress actions received for "
+                                    + "interface {} on dpn {} for vpn {} prefix {}", ifName, dpnId, vpnId,
+                                    currDestIpPrefix);
+                        }
                         BucketInfo bucket = new BucketInfo(listActionInfo);
+                        List<BucketInfo> listBucketInfo = new ArrayList<>();
 
                         listBucketInfo.add(bucket);
                         GroupEntity groupEntity = MDSALUtil.buildGroupEntity(dpnId, groupId, primaryIpAddress,
@@ -1027,7 +1035,13 @@ public class NexthopManager implements AutoCloseable {
                 if (egressActionMap.containsKey(egressInterface)) {
                     egressActions = egressActionMap.get(egressInterface);
                 } else {
-                    egressActions = getEgressActionsForInterface(egressInterface, actionInfos.size(), true);
+                    egressActions = getEgressActionsForInterface(egressInterface, actionInfos.size(),
+                            true, vpnId, vrfEntry.getDestPrefix());
+                    if (egressActions.isEmpty()) {
+                        LOG.error("Skipping getBucketsForRemoteNexthop: Empty list of egress actions received for "
+                                        + "interface {} on dpn {} for vpn {} prefix {} nextHop {}", ifName, dpnId,
+                                vpnId, vrfEntry.getDestPrefix(), nextHopPrefixIp);
+                    }
                     egressActionMap.put(egressInterface, egressActions);
                 }
                 if (egressActions.isEmpty()) {