[ONOS-6488] Fix failure when reinstall a VPLS

When removes and reinstalls a VPLS the VPLS operation manager doesn't
update intents because it didn't check if the intent from store is
installed or withdrawn.

Purge intents every time when removes interface or VPLS to clean the
intent store is a possible solution.

Change-Id: Ie06fb11e915b8f82f6753c8e47177ac4dc53dd17
This commit is contained in:
Yi Tseng 2017-05-18 14:46:04 -07:00 committed by Ray Milkey
parent 8c9e410846
commit ada511f800
2 changed files with 5 additions and 4 deletions

View File

@ -304,13 +304,12 @@ public class VplsOperationManager implements VplsOperationService {
// Error consumer
VplsOperation vplsOperation =
vplsOperationException.vplsOperation();
log.debug("VPLS operation failed: {}", vplsOperation);
log.warn(OP_EXEC_ERR,
vplsOperation.toString(),
vplsOperationException.getMessage());
VplsData vplsData = vplsOperation.vpls();
vplsData.state(VplsData.VplsState.FAILED);
vplsStore.updateVpls(vplsData);
log.error(OP_EXEC_ERR,
vplsOperation.toString(),
vplsOperationException.getMessage());
runningOperations.remove(vplsName);
});
log.debug("Applying operation: {}", operation);
@ -544,6 +543,7 @@ public class VplsOperationManager implements VplsOperationService {
private void removeVplsIntents() {
Set<Intent> intentsToWithdraw = getCurrentIntents();
applyIntentsSync(intentsToWithdraw, Direction.REMOVE);
intentsToWithdraw.forEach(intentService::purge);
}
/**

View File

@ -100,6 +100,7 @@ public class DistributedVplsStore
@Deactivate
protected void deactive() {
vplsDataStore.removeListener(vplsDataListener);
networkConfigService.removeConfig(appId);
log.info("Stopped");
}