BUG 5556: Unable to delete mac entries 23/37823/1
authorVishal Thapar <vishal.thapar@ericsson.com>
Tue, 29 Mar 2016 20:11:35 +0000 (01:41 +0530)
committerSam Hague <shague@redhat.com>
Tue, 19 Apr 2016 14:48:15 +0000 (14:48 +0000)
This adds a new class that acts as cache for rows received from hwvtep
device. Currently it only stores LogicalSwitches to be used for mac entry
operations and creatg VlanBindings in PhysicalPortUpdate

Change-Id: Ie9ad19d62020e100be533553b9394167d449c939
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
14 files changed:
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDeviceInfo.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsLocalRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsRemoteRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/UcastMacsLocalRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/UcastMacsRemoteRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/LogicalSwitchRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/LogicalSwitchUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/MacEntriesRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/McastMacsLocalUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/McastMacsRemoteUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/PhysicalPortUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/UcastMacsLocalUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/UcastMacsRemoteUpdateCommand.java

index db05b9a1dbab1d8113dc70880a676274199c678b..e3b124a9bab4a2b433042cc96fb68b6927c84e58 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2015, 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -65,6 +65,7 @@ public class HwvtepConnectionInstance implements OvsdbClient{
     private Entity connectedEntity;
     private EntityOwnershipCandidateRegistration deviceOwnershipCandidateRegistration;
     private HwvtepGlobalAugmentation initialCreatedData = null;
+    private HwvtepDeviceInfo deviceInfo;
 
 
     HwvtepConnectionInstance (ConnectionInfo key,OvsdbClient client,
@@ -73,6 +74,7 @@ public class HwvtepConnectionInstance implements OvsdbClient{
         this.client = client;
         this.instanceIdentifier = iid;
         this.txInvoker = txInvoker;
+        this.deviceInfo = new HwvtepDeviceInfo();
     }
 
     public void transact(TransactCommand command) {
@@ -293,4 +295,9 @@ public class HwvtepConnectionInstance implements OvsdbClient{
     public void setHwvtepGlobalAugmentation(HwvtepGlobalAugmentation hwvtepGlobalData) {
         this.initialCreatedData = hwvtepGlobalData;
     }
+
+    public HwvtepDeviceInfo getDeviceInfo() {
+        return this.deviceInfo;
+    }
+
 }
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDeviceInfo.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDeviceInfo.java
new file mode 100644 (file)
index 0000000..1cadd9d
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.ovsdb.hwvtepsouthbound;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.schema.hardwarevtep.LogicalSwitch;
+
+/*
+ * HwvtepDeviceInfo is used to store some of the table entries received
+ * in updates from a Hwvtep device. There will be one instance of this per
+ * Hwvtep device connected. Table entries are stored in a map keyed by
+ * uuids of respective rows.
+ * 
+ * Purpose of this class is to provide data present in tables which
+ * were updated in a previous transaction and are not available in
+ * current updatedRows. This allows us to handle updates for Tables
+ * which reference other tables and need information in those tables
+ * to add data to Operational data store.
+ * 
+ * e.g. Mac-entries in data store use logical-switch-ref as one of the
+ * keys. Mac-entry updates from switch rarely contain Logical_Switch
+ * table entries. To add mac-entries we need table entries from
+ * Logical_Switch table which were created in an earlier update.
+ * 
+ */
+public class HwvtepDeviceInfo {
+    private Map<UUID, LogicalSwitch> logicalSwitches = null;
+
+    public HwvtepDeviceInfo() {
+        this.logicalSwitches = new HashMap<>();
+    }
+
+    public void putLogicalSwitch(UUID uuid, LogicalSwitch lSwitch) {
+        logicalSwitches.put(uuid, lSwitch);
+    }
+
+    public LogicalSwitch getLogicalSwitch(UUID uuid) {
+        return logicalSwitches.get(uuid);
+    }
+
+    public LogicalSwitch removeLogicalSwitch(UUID uuid) {
+        return logicalSwitches.remove(uuid);
+    }
+
+    public Map<UUID, LogicalSwitch> getLogicalSwitches() {
+        return logicalSwitches;
+    }
+}
index 109914e11fee0d5f0e694b08e11a09d20d998d42..9490371119fe312b7c9ecd17334722eb6b239178 100644 (file)
@@ -119,7 +119,7 @@ public class McastMacsLocalRemoveCommand extends AbstractTransactCommand {
                         for (LocalMcastMacs macBefore: macListBefore) {
                             int i = 0;
                             for(; i < macListUpdated.size(); i++) {
-                                if (macBefore.getMacEntryKey().equals(macListUpdated.get(i).getMacEntryKey())) {
+                                if (macBefore.getKey().equals(macListUpdated.get(i).getKey())) {
                                     break;
                                 }
                             }
index 78fe8e657c0681ab840fe947f0a9c87764319d3f..a02eae68f7fead7ddfb2a85df32cfef307eadd44 100644 (file)
@@ -119,7 +119,7 @@ public class McastMacsRemoteRemoveCommand extends AbstractTransactCommand {
                         for (RemoteMcastMacs macBefore: macListBefore) {
                             int i = 0;
                             for(; i < macListUpdated.size(); i++) {
-                                if (macBefore.getMacEntryKey().equals(macListUpdated.get(i).getMacEntryKey())) {
+                                if (macBefore.getKey().equals(macListUpdated.get(i).getKey())) {
                                     break;
                                 }
                             }
index 85e175d7253b9540579b38d86071093f2487bfdb..c563c675ab2d35057329d90241f19086fc538d0d 100644 (file)
@@ -118,7 +118,7 @@ public class UcastMacsLocalRemoveCommand extends AbstractTransactCommand {
                         for (LocalUcastMacs macBefore: macListBefore) {
                             int i = 0;
                             for(; i < macListUpdated.size(); i++) {
-                                if (macBefore.getMacEntryKey().equals(macListUpdated.get(i).getMacEntryKey())) {
+                                if (macBefore.getKey().equals(macListUpdated.get(i).getKey())) {
                                     break;
                                 }
                             }
index 482c0d7f2ed97ebddaafa22c746f6b9033a83654..3126431b9696ce459e3570a9a74c50a8cfa39d31 100644 (file)
@@ -118,7 +118,7 @@ public class UcastMacsRemoteRemoveCommand extends AbstractTransactCommand {
                         for (RemoteUcastMacs macBefore: macListBefore) {
                             int i = 0;
                             for(; i < macListUpdated.size(); i++) {
-                                if (macBefore.getMacEntryKey().equals(macListUpdated.get(i).getMacEntryKey())) {
+                                if (macBefore.getKey().equals(macListUpdated.get(i).getKey())) {
                                     break;
                                 }
                             }
index 032e910245235b4df169657d6eb6507594dce981..9ec26d0e200093a8a90219594996b32dbf77e012 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2015, 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -39,6 +39,7 @@ public class LogicalSwitchRemoveCommand extends AbstractTransactionCommand {
                     .child(LogicalSwitches.class, new LogicalSwitchesKey(new HwvtepNodeName(lSwitch.getName())));
             // TODO Delete any references
             transaction.delete(LogicalDatastoreType.OPERATIONAL, switchIid);
+            getOvsdbConnectionInstance().getDeviceInfo().removeLogicalSwitch(lSwitch.getUuid());
         }
     }
 
index 9e0ab4b922239d3985505872afa3f0f69a3d50c2..efd48659559730bac7f536ad3dbc46e991c17122 100644 (file)
@@ -57,6 +57,7 @@ public class LogicalSwitchUpdateCommand extends AbstractTransactionCommand {
         if (connection.isPresent()) {
             Node connectionNode = buildConnectionNode(lSwitch);
             transaction.merge(LogicalDatastoreType.OPERATIONAL, connectionIId, connectionNode);
+            getOvsdbConnectionInstance().getDeviceInfo().putLogicalSwitch(lSwitch.getUuid(), lSwitch);
             // TODO: Delete entries that are no longer needed
         }
     }
index 50ec461f4d39c92e5075f6c65f2638168c8e2cfc..33a2d4fe3b96c1612f2f54daf795b8fc54db7c72 100644 (file)
@@ -9,8 +9,6 @@
 package org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md;
 
 import java.util.Collection;
-import java.util.Map;
-
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance;
@@ -44,11 +42,9 @@ import org.slf4j.LoggerFactory;
 public class MacEntriesRemoveCommand extends AbstractTransactionCommand {
 
     private static final Logger LOG = LoggerFactory.getLogger(MacEntriesRemoveCommand.class);
-    Map<UUID, LogicalSwitch> lSwitchUpdatedRows;
 
     public MacEntriesRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
         super(key, updates, dbSchema);
-        lSwitchUpdatedRows = TyperUtils.extractRowsUpdated(LogicalSwitch.class, getUpdates(), getDbSchema());
     }
 
 
@@ -131,12 +127,15 @@ public class MacEntriesRemoveCommand extends AbstractTransactionCommand {
     }
 
     private HwvtepLogicalSwitchRef getLogicalSwitchRef(UUID switchUUID) {
-        LogicalSwitch logicalSwitch = lSwitchUpdatedRows.get(switchUUID);
+        LogicalSwitch logicalSwitch = getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitch(switchUUID);
         if (logicalSwitch != null) {
             InstanceIdentifier<LogicalSwitches> lSwitchIid =
                     HwvtepSouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance(), logicalSwitch);
             return new HwvtepLogicalSwitchRef(lSwitchIid);
         }
+        LOG.debug("Failed to get LogicalSwitch {}", switchUUID);
+        LOG.trace("Available LogicalSwitches: {}",
+                        getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitches().values());
         return null;
     }
 
index 4ff016658a2780a61c46a05ab521ec9473ac8e00..a8f1228e0f4ff0bcafc8f559dbf434ead0d18085 100644 (file)
@@ -13,8 +13,6 @@ import com.google.common.base.Optional;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
-
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance;
@@ -51,14 +49,12 @@ public class McastMacsLocalUpdateCommand extends AbstractTransactionCommand {
     private Map<UUID, McastMacsLocal> updatedMMacsLocalRows;
     private Map<UUID, PhysicalLocatorSet> updatedPLocSetRows;
     private Map<UUID, PhysicalLocator> updatedPLocRows;
-    private Map<UUID, LogicalSwitch> updatedLSRows;
 
     public McastMacsLocalUpdateCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
         super(key, updates, dbSchema);
         updatedMMacsLocalRows = TyperUtils.extractRowsUpdated(McastMacsLocal.class, getUpdates(), getDbSchema());
         updatedPLocSetRows = TyperUtils.extractRowsUpdated(PhysicalLocatorSet.class, getUpdates(), getDbSchema());
         updatedPLocRows = TyperUtils.extractRowsUpdated(PhysicalLocator.class, getUpdates(), getDbSchema());
-        updatedLSRows = TyperUtils.extractRowsUpdated(LogicalSwitch.class, getUpdates(), getDbSchema());
     }
 
     @Override
@@ -104,7 +100,7 @@ public class McastMacsLocalUpdateCommand extends AbstractTransactionCommand {
     private void setLogicalSwitch(LocalMcastMacsBuilder mMacLocalBuilder, McastMacsLocal mMacLocal) {
         if (mMacLocal.getLogicalSwitchColumn() != null && mMacLocal.getLogicalSwitchColumn().getData() != null) {
             UUID lsUUID = mMacLocal.getLogicalSwitchColumn().getData();
-            LogicalSwitch lSwitch = updatedLSRows.get(lsUUID);
+            LogicalSwitch lSwitch = getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitch(lsUUID);
             if (lSwitch != null) {
                 InstanceIdentifier<LogicalSwitches> lSwitchIid =
                         HwvtepSouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance(), lSwitch);
index ed5ed5cd83a4fcccd4035da696350ce5101a316c..2f760c4b38f67e003298c241d649bcab43720166 100644 (file)
@@ -51,14 +51,12 @@ public class McastMacsRemoteUpdateCommand extends AbstractTransactionCommand {
     private Map<UUID, McastMacsRemote> updatedMMacsRemoteRows;
     private Map<UUID, PhysicalLocatorSet> updatedPLocSetRows;
     private Map<UUID, PhysicalLocator> updatedPLocRows;
-    private Map<UUID, LogicalSwitch> updatedLSRows;
 
     public McastMacsRemoteUpdateCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
         super(key, updates, dbSchema);
         updatedMMacsRemoteRows = TyperUtils.extractRowsUpdated(McastMacsRemote.class, getUpdates(), getDbSchema());
         updatedPLocSetRows = TyperUtils.extractRowsUpdated(PhysicalLocatorSet.class, getUpdates(), getDbSchema());
         updatedPLocRows = TyperUtils.extractRowsUpdated(PhysicalLocator.class, getUpdates(), getDbSchema());
-        updatedLSRows = TyperUtils.extractRowsUpdated(LogicalSwitch.class, getUpdates(), getDbSchema());
     }
 
     @Override
@@ -104,7 +102,7 @@ public class McastMacsRemoteUpdateCommand extends AbstractTransactionCommand {
     private void setLogicalSwitch(RemoteMcastMacsBuilder mMacRemoteBuilder, McastMacsRemote mMacRemote) {
         if (mMacRemote.getLogicalSwitchColumn() != null && mMacRemote.getLogicalSwitchColumn().getData() != null) {
             UUID lsUUID = mMacRemote.getLogicalSwitchColumn().getData();
-            LogicalSwitch lSwitch = updatedLSRows.get(lsUUID);
+            LogicalSwitch lSwitch = getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitch(lsUUID);
             if (lSwitch != null) {
                 InstanceIdentifier<LogicalSwitches> lSwitchIid =
                         HwvtepSouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance(), lSwitch);
index 1706c8aa1da7b691e6eb82c4bd3e60eb26170bcc..315083d154fa34b6e2f1e88f637d2f582db19c7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2015, 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -56,14 +56,12 @@ public class PhysicalPortUpdateCommand extends AbstractTransactionCommand {
     private Map<UUID, PhysicalPort> updatedPPRows;
     private Map<UUID, PhysicalPort> oldPPRows;
     private Map<UUID, PhysicalSwitch> switchUpdatedRows;
-    private Map<UUID, LogicalSwitch> lSwitchUpdatedRows;
 
     public PhysicalPortUpdateCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
         super(key, updates, dbSchema);
         updatedPPRows = TyperUtils.extractRowsUpdated(PhysicalPort.class, getUpdates(), getDbSchema());
         oldPPRows = TyperUtils.extractRowsOld(PhysicalPort.class, getUpdates(), getDbSchema());
         switchUpdatedRows = TyperUtils.extractRowsUpdated(PhysicalSwitch.class, getUpdates(), getDbSchema());
-        lSwitchUpdatedRows = TyperUtils.extractRowsUpdated(LogicalSwitch.class, getUpdates(), getDbSchema());
     }
 
     @Override
@@ -181,12 +179,15 @@ public class PhysicalPortUpdateCommand extends AbstractTransactionCommand {
     }
 
     private HwvtepLogicalSwitchRef getLogicalSwitchRef(UUID switchUUID) {
-        LogicalSwitch logicalSwitch = lSwitchUpdatedRows.get(switchUUID);
+        LogicalSwitch logicalSwitch = getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitch(switchUUID);
         if (logicalSwitch != null) {
             InstanceIdentifier<LogicalSwitches> lSwitchIid =
                     HwvtepSouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance(), logicalSwitch);
             return new HwvtepLogicalSwitchRef(lSwitchIid);
         }
+        LOG.debug("Failed to get LogicalSwitch {}", switchUUID);
+        LOG.trace("Available LogicalSwitches: {}",
+                        getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitches().values());
         return null;
     }
 
index cc4ae95048e787c333c9a1d68d4e7a9103c8b43e..f542dc6a1a14613a96102d5f7113f4e5371b500c 100644 (file)
@@ -45,13 +45,11 @@ public class UcastMacsLocalUpdateCommand extends AbstractTransactionCommand {
 
     private Map<UUID, UcastMacsLocal> updatedUMacsLocalRows;
     private Map<UUID, PhysicalLocator> updatedPLocRows;
-    private Map<UUID, LogicalSwitch> updatedLSRows;
 
     public UcastMacsLocalUpdateCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
         super(key, updates, dbSchema);
         updatedUMacsLocalRows = TyperUtils.extractRowsUpdated(UcastMacsLocal.class, getUpdates(), getDbSchema());
         updatedPLocRows = TyperUtils.extractRowsUpdated(PhysicalLocator.class, getUpdates(), getDbSchema());
-        updatedLSRows = TyperUtils.extractRowsUpdated(LogicalSwitch.class, getUpdates(), getDbSchema());
     }
 
     @Override
@@ -95,7 +93,7 @@ public class UcastMacsLocalUpdateCommand extends AbstractTransactionCommand {
         }
         if (ucml.getLogicalSwitchColumn() != null && ucml.getLogicalSwitchColumn().getData() != null) {
             UUID lsUUID = ucml.getLogicalSwitchColumn().getData();
-            LogicalSwitch logicalSwitch = updatedLSRows.get(lsUUID);
+            LogicalSwitch logicalSwitch = getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitch(lsUUID);
             if (logicalSwitch != null) {
                 InstanceIdentifier<LogicalSwitches> lSwitchIid =
                         HwvtepSouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance(), logicalSwitch);
index e26d6670f153d7b6c50a38ece5d87c27f98d2007..a709f69e666a086ef9528824f73a46df27b740b8 100644 (file)
@@ -45,13 +45,11 @@ public class UcastMacsRemoteUpdateCommand extends AbstractTransactionCommand {
 
     private final Map<UUID, UcastMacsRemote> updatedUMacsRemoteRows;
     private final Map<UUID, PhysicalLocator> updatedPLocRows;
-    private final Map<UUID, LogicalSwitch> updatedLSRows;
 
     public UcastMacsRemoteUpdateCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
         super(key, updates, dbSchema);
         updatedUMacsRemoteRows = TyperUtils.extractRowsUpdated(UcastMacsRemote.class, getUpdates(), getDbSchema());
         updatedPLocRows = TyperUtils.extractRowsUpdated(PhysicalLocator.class, getUpdates(), getDbSchema());
-        updatedLSRows = TyperUtils.extractRowsUpdated(LogicalSwitch.class, getUpdates(), getDbSchema());
     }
 
     @Override
@@ -96,7 +94,7 @@ public class UcastMacsRemoteUpdateCommand extends AbstractTransactionCommand {
         if (uMacRemote.getLogicalSwitchColumn() != null
                 && uMacRemote.getLogicalSwitchColumn().getData() != null) {
             UUID lsUUID = uMacRemote.getLogicalSwitchColumn().getData();
-            final LogicalSwitch logicalSwitch = updatedLSRows.get(lsUUID);
+            final LogicalSwitch logicalSwitch = getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitch(lsUUID);
             if (logicalSwitch != null) {
                 InstanceIdentifier<LogicalSwitches> lSwitchIid =
                         HwvtepSouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance(), logicalSwitch);