alshabib
Committed by Gerrit Code Review

Fix a bug where default rules were not pushed after restarting mininet.

Change-Id: Icf4c7ed009a5938d28b58128cfc226067a0d4c9e
......@@ -388,20 +388,31 @@ public class FlowRuleManager
public void pushFlowMetrics(DeviceId deviceId, Iterable<FlowEntry> flowEntries) {
Set<FlowEntry> storedRules = Sets.newHashSet(store.getFlowEntries(deviceId));
for (FlowEntry rule : flowEntries) {
if (storedRules.remove(rule)) {
// we both have the rule, let's update some info then.
flowAdded(rule);
} else {
// the device has a rule the store does not have
extraneousFlow(rule);
for (FlowEntry rule : flowEntries) {
try {
if (storedRules.remove(rule)) {
// we both have the rule, let's update some info then.
flowAdded(rule);
} else {
// the device has a rule the store does not have
extraneousFlow(rule);
}
} catch (Throwable e) {
log.debug("Can't add missing flow rule {}", e.getMessage());
continue;
}
}
for (FlowEntry rule : storedRules) {
try {
// there are rules in the store that aren't on the switch
flowMissing(rule);
} catch (Throwable e) {
log.debug("Can't add missing flow rule {}", e.getMessage());
continue;
}
}
}
for (FlowEntry rule : storedRules) {
// there are rules in the store that aren't on the switch
flowMissing(rule);
}
}
@Override
......
......@@ -672,13 +672,14 @@ public class DistributedFlowRuleStore
// This node is the new master, populate local structure
// from backup
loadFromBackup(did);
} else {
}
//else {
// This node is no longer the master holder,
// clean local structure
removeFromPrimary(did);
//removeFromPrimary(did);
// TODO: probably should stop pending backup activities in
// executors to avoid overwriting with old value
}
//}
break;
default:
break;
......