BUG-7976: Race between peer removal and routes update 10/53810/7
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Fri, 24 Mar 2017 19:26:08 +0000 (20:26 +0100)
committerRobert Varga <nite@hq.sk>
Tue, 28 Mar 2017 18:37:36 +0000 (18:37 +0000)
commit1e29a1046ff3d16660c3074df0a6a4b279cd951e
tree9d80fc375559eeb01aa73f97b6ae9bf8bf98922f
parente59988368f20a986f762b16fb7db36c6b0c45bdd
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