extends AsyncClusteredDataTreeChangeListenerBase<DpnInterfaces, ElanDpnInterfaceClusteredListener> {
private static final Logger LOG = LoggerFactory.getLogger(ElanDpnInterfaceClusteredListener.class);
+ private static final Logger EVENT_LOGGER = LoggerFactory.getLogger("NetvirtEventLogger");
private final DataBroker broker;
private final EntityOwnershipUtils entityOwnershipUtils;
@Override
public void add(InstanceIdentifier<DpnInterfaces> identifier, final DpnInterfaces dpnInterfaces) {
final String elanName = getElanName(identifier);
-
+ EVENT_LOGGER.debug("ELAN-DpnInterface, ADD DPN {} Instance {}", dpnInterfaces.getDpId(), elanName);
jobCoordinator.enqueueJob(elanName + ":l2gw", () -> {
elanInstanceDpnsCache.add(getElanName(identifier), dpnInterfaces);
if (entityOwnershipUtils.isEntityOwner(HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
operTx -> LoggingFutures.addErrorLogging(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
confTx -> ElanUtils.updateOperationalDataStore(idManager, update, new ArrayList<>(), confTx,
- operTx)), LOG, "Error updating ELAN tag in ELAN instance")), LOG,
- "Error updating ELAN tag in ELAN instance");
+ operTx)), LOG, "Error updating ELAN tag in ELAN instance for config "
+ + "transaction")), LOG,
+ "Error updating ELAN tag in ELAN instance for operational transaction");
} else {
jobCoordinator.enqueueJob(elanName, () -> elanInterfaceManager.handleunprocessedElanInterfaces(update),
ElanConstants.JOB_MAX_RETRIES);
if (elanInfo == null) {
LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
confTx -> ElanUtils.updateOperationalDataStore(idManager, elanInstanceAdded, new ArrayList<>(),
- confTx, operTx)), LOG, "Error adding an ELAN instance");
+ confTx, operTx)), LOG, "Error adding an ELAN instance for config transaction");
}
- }), LOG, "Error adding an ELAN instance");
+ }), LOG, "Error adding an ELAN instance for operational transaction");
}
@Override
if (!elanInterfaces.contains(elanInterfaceAdded)) {
elanInterfaces.add(elanInterfaceAdded);
}
+ LOG.error("ELAN tag for instance {} is not created. Adding it to unprocessed list."
+ + " Recreate the network if this message is seen multiple times", elanInstanceName);
unProcessedElanInterfaces.put(elanInstanceName, elanInterfaces);
return;
}
long macTimeStamp = oldMacEntry.getControllerLearnedForwardingEntryTimestamp().longValue();
if (System.currentTimeMillis() > macTimeStamp + 1000) {
InstanceIdentifier<MacEntry> macEntryId = ElanUtils
- .getInterfaceMacEntriesIdentifierOperationalDataPath(interfaceName,
+ .getInterfaceMacEntriesIdentifierOperationalDataPath(oldMacEntry.getInterface(),
physAddress);
tx.delete(macEntryId);
} else {
if (elanTag == null || elanTag.longValue() == 0L) {
elanTag = retrieveNewElanTag(idManager, elanInstanceName);
}
+ if (elanTag.longValue() == 0L) {
+ LOG.error("ELAN tag creation failed for elan instance {}. Not updating the ELAN DS. "
+ + "Recreate network for recovery", elanInstanceName);
+ return null;
+ }
Elan elanInfo = new ElanBuilder().setName(elanInstanceName).setElanInterfaces(elanInterfaces)
.withKey(new ElanKey(elanInstanceName)).build();