BUG-7976: Race between peer removal and routes update 79/53879/5
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Fri, 24 Mar 2017 19:26:08 +0000 (20:26 +0100)
committerRobert Varga <nite@hq.sk>
Mon, 10 Apr 2017 07:05:02 +0000 (07:05 +0000)
commitaa71d43f58dc8b5242553ecc75a196fb5c0ca5e6
tree20638c4bc2e6b6ee84b04a5b8a8d71785d572763
parent1900f3edb1aa1a8697f6140e463aa1e9c483f423
BUG-7976: Race between peer removal and routes update

There is a race condition when we are advertizing routes,
and a session peer goes down which will end in
removing the peer from DS.
Since advertizement and removal are done by 2 different tx,
we need to do it blocking mode, and not route should be
advertized until peer is removed and vice versa, peer
should not be removed until routes are advertized.
Otherwise toure update will try to update a peer/path which
is not longer present.
Fix by rework PeerExportGroup & ExportPolicyPeerTracker,
now instead of generate PeerExportGroup each time a peer
is reg/unreg,  we make PeerExportGroup work as a
blocking registry to solve previous issue.

Change-Id: I46a27871bfa2aa2a632e3bfb76061105c62bb6d2
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/add/AddPathAbstractRouteEntry.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/base/BaseAbstractRouteEntry.java
bgp/path-selection-mode/src/test/java/org/opendaylight/protocol/bgp/mode/impl/AbstractRouteEntryTest.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ExportPolicyPeerTrackerImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/PeerExportGroupImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/PeerExportGroupRegistry.java [new file with mode: 0644]
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/PeerExportGroup.java