Fix for empty flooding groups due to bucket add/remove commands being reordered, and

triggered by port up/down events very close to each other.

Change-Id: Ibbd7cc6eb6df35396175619d95439acd6da904b8
This commit is contained in:
Saurav Das 2017-12-05 15:00:23 -08:00 committed by Charles Chan
parent 7c27bb4b38
commit f14d9ef158
4 changed files with 16 additions and 14 deletions

View File

@ -1353,7 +1353,7 @@ public class SegmentRoutingManager implements SegmentRoutingService {
log.warn(e.getMessage() + " Aborting processDeviceAdded.");
return;
}
log.debug("updating groupHandlerMap with new config for device: {}",
log.debug("updating groupHandlerMap with new grpHdlr for device: {}",
deviceId);
groupHandlerMap.put(deviceId, groupHandler);
}

View File

@ -621,7 +621,7 @@ public class DefaultGroupHandler {
if (nextId == -1) {
if (portUp) {
log.debug("**Creating flooding group for first port enabled in"
+ " subnet {} on dev {} port {}", vlanId, deviceId, port);
+ " vlan {} on dev {} port {}", vlanId, deviceId, port);
createBcastGroupFromVlan(vlanId, Collections.singleton(port));
} else {
log.warn("Could not find flooding group for subnet {} on dev:{} when"
@ -1017,8 +1017,8 @@ public class DefaultGroupHandler {
);
NextObjective nextObj = nextObjBuilder.add(context);
flowObjectiveService.next(deviceId, nextObj);
log.debug("createBcastGroupFromVlan: Submitted next objective {} in device {}",
nextId, deviceId);
log.debug("createBcastGroupFromVlan: Submitted next objective {} "
+ "for vlan: {} in device {}", nextId, vlanId, deviceId);
vlanNextObjStore.put(key, nextId);
}

View File

@ -15,6 +15,7 @@
*/
package org.onosproject.net.flowobjective.impl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.apache.felix.scr.annotations.Activate;
@ -138,7 +139,7 @@ public class FlowObjectiveManager implements FlowObjectiveService {
// instance, via the DistributedFlowObjectiveStore.
private final Map<Integer, Set<PendingFlowObjective>> pendingForwards =
Maps.newConcurrentMap();
private final Map<Integer, Set<PendingFlowObjective>> pendingNexts =
private final Map<Integer, List<PendingFlowObjective>> pendingNexts =
Maps.newConcurrentMap();
// local store to track which nextObjectives were sent to which device
@ -317,7 +318,7 @@ public class FlowObjectiveManager implements FlowObjectiveService {
pendingNexts.compute(next.id(), (id, pending) -> {
PendingFlowObjective pendfo = new PendingFlowObjective(deviceId, next);
if (pending == null) {
return Sets.newHashSet(pendfo);
return Lists.newArrayList(pendfo);
} else {
pending.add(pendfo);
return pending;
@ -550,17 +551,18 @@ public class FlowObjectiveManager implements FlowObjectiveService {
}
// now check for pending next-objectives
List<PendingFlowObjective> pendNexts;
synchronized (pendingNexts) {
// needs to be synchronized for queueObjective lookup
pending = pendingNexts.remove(event.subject());
pendNexts = pendingNexts.remove(event.subject());
}
if (pending == null) {
if (pendNexts == null) {
log.debug("No next objectives pending for this "
+ "obj event {}", event);
} else {
log.debug("Processing {} pending next objectives for nextId {}",
pending.size(), event.subject());
pending.forEach(p -> getDevicePipeliner(p.deviceId())
pendNexts.size(), event.subject());
pendNexts.forEach(p -> getDevicePipeliner(p.deviceId())
.next((NextObjective) p.flowObjective()));
}
}
@ -666,7 +668,7 @@ public class FlowObjectiveManager implements FlowObjectiveService {
}
for (Integer nextId : pendingNexts.keySet()) {
Set<PendingFlowObjective> pnext = pendingNexts.get(nextId);
List<PendingFlowObjective> pnext = pendingNexts.get(nextId);
StringBuilder pend = new StringBuilder();
pend.append("NextId: ")
.append(nextId);

View File

@ -721,7 +721,7 @@ public class Ofdpa2Pipeline extends AbstractHandlerBehaviour implements Pipeline
if (matchInPortTmacTable()) {
selector.matchInPort(pnum);
} else {
log.info("Pipeline does not support IN_PORT matching in TMAC table, " +
log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
"ignoring the IN_PORT criteria");
}
}
@ -766,7 +766,7 @@ public class Ofdpa2Pipeline extends AbstractHandlerBehaviour implements Pipeline
if (matchInPortTmacTable()) {
selector.matchInPort(pnum);
} else {
log.info("Pipeline does not support IN_PORT matching in TMAC table, " +
log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
"ignoring the IN_PORT criteria");
}
}
@ -811,7 +811,7 @@ public class Ofdpa2Pipeline extends AbstractHandlerBehaviour implements Pipeline
if (matchInPortTmacTable()) {
selector.matchInPort(pnum);
} else {
log.info("Pipeline does not support IN_PORT matching in TMAC table, " +
log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
"ignoring the IN_PORT criteria");
}
}