Skip to content
Snippets Groups Projects
Commit 2d6e0f73 authored by Ryan Izard's avatar Ryan Izard
Browse files

fix LLDP HA role handling

parent 201dbb86
No related branches found
No related tags found
No related merge requests found
...@@ -1817,9 +1817,9 @@ IFloodlightModule, IInfoProvider { ...@@ -1817,9 +1817,9 @@ IFloodlightModule, IInfoProvider {
} }
if (autoPortFastFeature) if (autoPortFastFeature)
log.info("Setting autoportfast feature to ON"); log.debug("Setting autoportfast feature to ON");
else else
log.info("Setting autoportfast feature to OFF"); log.debug("Setting autoportfast feature to OFF");
} }
/** /**
...@@ -2017,6 +2017,7 @@ IFloodlightModule, IInfoProvider { ...@@ -2017,6 +2017,7 @@ IFloodlightModule, IInfoProvider {
this.ignoreMACSet = Collections.newSetFromMap( this.ignoreMACSet = Collections.newSetFromMap(
new ConcurrentHashMap<MACRange,Boolean>()); new ConcurrentHashMap<MACRange,Boolean>());
this.haListener = new HAListenerDelegate(); this.haListener = new HAListenerDelegate();
this.floodlightProviderService.addHAListener(this.haListener);
registerLinkDiscoveryDebugCounters(); registerLinkDiscoveryDebugCounters();
} }
...@@ -2056,7 +2057,9 @@ IFloodlightModule, IInfoProvider { ...@@ -2056,7 +2057,9 @@ IFloodlightModule, IInfoProvider {
@Override @Override
public void run() { public void run() {
try { try {
discoverLinks(); if (role == null || role == HARole.ACTIVE) { /* don't send if we just transitioned to STANDBY */
discoverLinks();
}
} catch (StorageException e) { } catch (StorageException e) {
shutdownService.terminate("Storage exception in LLDP send timer. Terminating process " + e, 0); shutdownService.terminate("Storage exception in LLDP send timer. Terminating process " + e, 0);
} catch (Exception e) { } catch (Exception e) {
...@@ -2171,14 +2174,11 @@ IFloodlightModule, IInfoProvider { ...@@ -2171,14 +2174,11 @@ IFloodlightModule, IInfoProvider {
private class HAListenerDelegate implements IHAListener { private class HAListenerDelegate implements IHAListener {
@Override @Override
public void transitionToActive() { public void transitionToActive() {
if (log.isTraceEnabled()) { log.warn("Sending LLDPs due to HA change from STANDBY->ACTIVE");
log.trace("Sending LLDPs "
+ "to HA change from STANDBY->MASTER");
}
LinkDiscoveryManager.this.role = HARole.ACTIVE; LinkDiscoveryManager.this.role = HARole.ACTIVE;
clearAllLinks(); clearAllLinks();
readTopologyConfigFromStorage(); readTopologyConfigFromStorage();
log.debug("Role Change to Master: Rescheduling discovery task."); log.debug("Role Change to Master: Rescheduling discovery tasks");
discoveryTask.reschedule(1, TimeUnit.MICROSECONDS); discoveryTask.reschedule(1, TimeUnit.MICROSECONDS);
} }
...@@ -2191,13 +2191,13 @@ IFloodlightModule, IInfoProvider { ...@@ -2191,13 +2191,13 @@ IFloodlightModule, IInfoProvider {
@Override @Override
public String getName() { public String getName() {
return LinkDiscoveryManager.this.getName(); return MODULE_NAME;
} }
@Override @Override
public boolean isCallbackOrderingPrereq(HAListenerTypeMarker type, public boolean isCallbackOrderingPrereq(HAListenerTypeMarker type,
String name) { String name) {
return ("topology".equals(name)); return false;
} }
@Override @Override
...@@ -2208,13 +2208,11 @@ IFloodlightModule, IInfoProvider { ...@@ -2208,13 +2208,11 @@ IFloodlightModule, IInfoProvider {
@Override @Override
public void transitionToStandby() { public void transitionToStandby() {
//no-op log.warn("Disabling LLDPs due to HA change from ACTIVE->STANDBY");
LinkDiscoveryManager.this.role = HARole.STANDBY;
} }
} }
@Override @Override
public void switchDeactivated(DatapathId switchId) { public void switchDeactivated(DatapathId switchId) { }
// TODO Auto-generated method stub
}
} }
\ No newline at end of file
...@@ -668,8 +668,7 @@ public class TopologyManager implements IFloodlightModule, ITopologyService, IRo ...@@ -668,8 +668,7 @@ public class TopologyManager implements IFloodlightModule, ITopologyService, IRo
@Override @Override
public boolean isCallbackOrderingPrereq(HAListenerTypeMarker type, public boolean isCallbackOrderingPrereq(HAListenerTypeMarker type,
String name) { String name) {
return "linkdiscovery".equals(name) || return "linkdiscovery".equals(name);
"tunnelmanager".equals(name);
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment