Fix for VM Migration Table 51 stale entry 78/70278/10
authorashwinbc <ashwin.b.c@ericsson.com>
Tue, 3 Apr 2018 10:51:55 +0000 (16:21 +0530)
committerSridhar Gaddam <sgaddam@redhat.com>
Mon, 14 May 2018 17:27:17 +0000 (17:27 +0000)
Description: An issue is observed when
ElanLearnVpnVip MIP MAC and Interface
MAC are same. During migration,
ElanLearntVpnVipToPortListener remove
deletes MAC entry from ElanInterfaceForwardingEntries,
which is referred by ElanInterfaceStateChangeListener
remove workflow, which is started after the
ElanInterfaceForwardingEntries thread
completes its course of action. Both threads
have an action to delete DMAC flow entries,
but the first thread refers InterfaceManager for
InterfaceInfo which returns null, hence skips the
delete DMAC workflow, but deletes the MAC entry.
Other thread refers MAC entry, which has been deleted
by first thread, hence this too skips delete workflow.

This fix address the problem by deleting MAC entry in
first thread, only if InterfaceInfo is not null so that second
thread can delete DMAC entry as well delete MAC entry
during its course of action.

Change-Id: Icc7d15b62f6aaa3b1bae1844d9a013043b8d541d
Signed-off-by: ashwinbc <ashwin.b.c@ericsson.com>
elanmanager/impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanLearntVpnVipToPortListener.java

index b660dc99b80a7b6108d0416907fc7094c9837dab..33022de7a1b85552a11dbe0c92d033517b38be3a 100644 (file)
@@ -185,11 +185,11 @@ public class ElanLearntVpnVipToPortListener extends
             InterfaceInfo interfaceInfo = interfaceManager.getInterfaceInfo(interfaceName);
             if (macEntry != null && interfaceInfo != null) {
                 elanUtils.deleteMacFlows(elanInstanceCache.get(elanName).orNull(), interfaceInfo, macEntry, flowTx);
+                interfaceTx.delete(LogicalDatastoreType.OPERATIONAL,
+                        ElanUtils.getInterfaceMacEntriesIdentifierOperationalDataPath(interfaceName, physAddress));
+                interfaceTx.delete(LogicalDatastoreType.OPERATIONAL,
+                        ElanUtils.getMacEntryOperationalDataPath(elanName, physAddress));
             }
-            interfaceTx.delete(LogicalDatastoreType.OPERATIONAL,
-                    ElanUtils.getInterfaceMacEntriesIdentifierOperationalDataPath(interfaceName, physAddress));
-            interfaceTx.delete(LogicalDatastoreType.OPERATIONAL,
-                    ElanUtils.getMacEntryOperationalDataPath(elanName, physAddress));
         }
     }