Fix for hosttracker. Ignore ARP messages from internal nodes.
[controller.git] / opendaylight / hosttracker / implementation / src / main / java / org / opendaylight / controller / hosttracker / internal / HostTracker.java
index 4a5259031724853d438c6ed45797bc985ae3e6dc..367df5ebb05e87e7b93737f9a9db03bd43075e9f 100644 (file)
@@ -181,9 +181,9 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
         logger.debug("Creating Cache for HostTracker");
         try {
             this.clusterContainerService.createCache(ACTIVE_HOST_CACHE,
-                    EnumSet.of(IClusterServices.cacheMode.NON_TRANSACTIONAL));
+                    EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
             this.clusterContainerService.createCache(INACTIVE_HOST_CACHE,
-                    EnumSet.of(IClusterServices.cacheMode.NON_TRANSACTIONAL));
+                    EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
         } catch (CacheConfigException cce) {
             logger.error("Cache couldn't be created for HostTracker -  check cache mode");
         } catch (CacheExistException cce) {
@@ -434,7 +434,15 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
     }
 
     private void replaceHost(InetAddress networkAddr, HostNodeConnector removedHost, HostNodeConnector newHost) {
+        // Ignore ARP messages from internal nodes
+        NodeConnector newHostNc = newHost.getnodeConnector();
+        boolean newHostIsInternal = topologyManager.isInternal(newHostNc);
+        if (newHostIsInternal) {
+            return;
+        }
+
         newHost.initArpSendCountDown();
+
         if (hostsDB.replace(networkAddr, removedHost, newHost)) {
             logger.debug("Host move occurred: Old Host IP:{}, New Host IP: {}", removedHost.getNetworkAddress()
                     .getHostAddress(), newHost.getNetworkAddress().getHostAddress());