Minor changes in Elan Manager 35/86735/6
authorAmitesh Soni <amitesh.soni@ericsson.com>
Thu, 9 Jan 2020 06:04:55 +0000 (11:34 +0530)
committerKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Mon, 17 Feb 2020 15:31:44 +0000 (15:31 +0000)
Change in method enqueueJobForMacSpecificTasks: Corrected the
wrong data entry that was being passed during VM migration

Added a few log statements

Signed-off-by: Amitesh Soni <amitesh.soni@ericsson.com>
Change-Id: I1d3fb93f0965605ec9914d84ebaf11d4f8f73c52

elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanDpnInterfaceClusteredListener.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInstanceManager.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInterfaceManager.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanPacketInHandler.java
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/utils/ElanUtils.java

index d18882be9530f86219547c697fbb51ccc289f6c3..247c967b6d97f87e31b29b778121b688ffd7cc14 100644 (file)
@@ -44,6 +44,7 @@ public class ElanDpnInterfaceClusteredListener
         extends AsyncClusteredDataTreeChangeListenerBase<DpnInterfaces, ElanDpnInterfaceClusteredListener> {
 
     private static final Logger LOG = LoggerFactory.getLogger(ElanDpnInterfaceClusteredListener.class);
+    private static final Logger EVENT_LOGGER = LoggerFactory.getLogger("NetvirtEventLogger");
 
     private final DataBroker broker;
     private final EntityOwnershipUtils entityOwnershipUtils;
@@ -153,7 +154,7 @@ public class ElanDpnInterfaceClusteredListener
     @Override
     public void add(InstanceIdentifier<DpnInterfaces> identifier, final DpnInterfaces dpnInterfaces) {
         final String elanName = getElanName(identifier);
-
+        EVENT_LOGGER.debug("ELAN-DpnInterface, ADD DPN {} Instance {}", dpnInterfaces.getDpId(), elanName);
         jobCoordinator.enqueueJob(elanName + ":l2gw", () -> {
             elanInstanceDpnsCache.add(getElanName(identifier), dpnInterfaces);
             if (entityOwnershipUtils.isEntityOwner(HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
index 925b28802eba45eb4b42f4222235e85fb7511c3c..f14edc18459051e296be0939783b6f65cfa65829 100644 (file)
@@ -114,8 +114,9 @@ public class ElanInstanceManager extends AsyncDataTreeChangeListenerBase<ElanIns
                     operTx -> LoggingFutures.addErrorLogging(
                         txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
                             confTx -> ElanUtils.updateOperationalDataStore(idManager, update, new ArrayList<>(), confTx,
-                                operTx)), LOG, "Error updating ELAN tag in ELAN instance")), LOG,
-                    "Error updating ELAN tag in ELAN instance");
+                                operTx)), LOG, "Error updating ELAN tag in ELAN instance for config "
+                                    + "transaction")), LOG,
+                    "Error updating ELAN tag in ELAN instance for operational transaction");
             } else {
                 jobCoordinator.enqueueJob(elanName, () -> elanInterfaceManager.handleunprocessedElanInterfaces(update),
                     ElanConstants.JOB_MAX_RETRIES);
@@ -132,9 +133,9 @@ public class ElanInstanceManager extends AsyncDataTreeChangeListenerBase<ElanIns
             if (elanInfo == null) {
                 LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
                     confTx -> ElanUtils.updateOperationalDataStore(idManager, elanInstanceAdded, new ArrayList<>(),
-                        confTx, operTx)), LOG, "Error adding an ELAN instance");
+                        confTx, operTx)), LOG, "Error adding an ELAN instance for config transaction");
             }
-        }), LOG, "Error adding an ELAN instance");
+        }), LOG, "Error adding an ELAN instance for operational transaction");
     }
 
     @Override
index 978a75b79d4fbe382dcbd3e138dd420b0c75403d..99c27429f4ac34c35e9757f9a8da1c5675fbf672 100644 (file)
@@ -637,6 +637,8 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase<ElanIn
                 if (!elanInterfaces.contains(elanInterfaceAdded)) {
                     elanInterfaces.add(elanInterfaceAdded);
                 }
+                LOG.error("ELAN tag for instance {} is not created. Adding it to unprocessed list."
+                        + " Recreate the network if this message is seen multiple times", elanInstanceName);
                 unProcessedElanInterfaces.put(elanInstanceName, elanInterfaces);
                 return;
             }
index 2f56465eff02076f4d4b9c2041ea0e0c19fbdd75..f39d58cafb4f54c00f7db8af0f0b3ef6bcda165f 100755 (executable)
@@ -177,7 +177,7 @@ public class ElanPacketInHandler implements PacketProcessingListener {
                     long macTimeStamp = oldMacEntry.getControllerLearnedForwardingEntryTimestamp().longValue();
                     if (System.currentTimeMillis() > macTimeStamp + 1000) {
                         InstanceIdentifier<MacEntry> macEntryId = ElanUtils
-                                .getInterfaceMacEntriesIdentifierOperationalDataPath(interfaceName,
+                                .getInterfaceMacEntriesIdentifierOperationalDataPath(oldMacEntry.getInterface(),
                                         physAddress);
                         tx.delete(macEntryId);
                     } else {
index 6ca73236fa17d96e6c670b633b26606ac4e4268f..cef193f43982413206446267ce114d1c6d3945f2 100755 (executable)
@@ -1160,6 +1160,11 @@ public class ElanUtils {
         if (elanTag == null || elanTag.longValue() == 0L) {
             elanTag = retrieveNewElanTag(idManager, elanInstanceName);
         }
+        if (elanTag.longValue() == 0L) {
+            LOG.error("ELAN tag creation failed for elan instance {}. Not updating the ELAN DS. "
+                    + "Recreate network for recovery", elanInstanceName);
+            return null;
+        }
         Elan elanInfo = new ElanBuilder().setName(elanInstanceName).setElanInterfaces(elanInterfaces)
                 .withKey(new ElanKey(elanInstanceName)).build();