- added null check in BGP topology builder removeObject() method to
gracefully handle issue created by BUG-6577
- when destroying operational topology to recover from a failure,
flush the internally stored topology info as well so that both are in sync
Change-Id: Id239d74738d43dd63177aa3b2ba1d3d9136c3338
Signed-off-by: Ajay <ajayl.bro@gmail.com>
(cherry picked from commit
b4657f9d04a5e0d30fa6d275ef933c420d9016c8)
@Override
protected final void removeObject(final ReadWriteTransaction trans, final InstanceIdentifier<T> id, final T value) {
+ if (value == null) {
+ LOG.error("Empty before-data received in delete data change notification for instance id {}", id);
+ return;
+ }
+
final NodeId ni = advertizingNode(getAttributes(value));
if (ni == null) {
return;
}
}
}
+
+ @Override
+ protected void clearTopology() {
+ this.nodes.clear();
+ }
}
protected abstract void removeObject(ReadWriteTransaction trans, InstanceIdentifier<T> id, T value);
+ protected abstract void clearTopology();
+
@Override
public final InstanceIdentifier<Topology> getInstanceIdentifier() {
return this.topology;
} catch (final TransactionCommitFailedException e) {
LOG.error("Unable to reset operational topology {} (transaction {})", this.topology, trans.getIdentifier(), e);
}
+ clearTopology();
}
/**
@Override
protected void removeObject(final ReadWriteTransaction trans,
final InstanceIdentifier<LinkstateRoute> id, final LinkstateRoute value) {
+ if (value == null) {
+ LOG.error("Empty before-data received in delete data change notification for instance id {}", id);
+ return;
+ }
+
final UriBuilder base = new UriBuilder(value);
final ObjectType t = value.getObjectType();
protected InstanceIdentifier<LinkstateRoute> getRouteWildcard(final InstanceIdentifier<Tables> tablesId) {
return tablesId.child((Class)LinkstateRoutes.class).child(LinkstateRoute.class);
}
+
+ @Override
+ protected void clearTopology() {
+ this.nodes.clear();
+ }
}