Race condition in deleting VPN routes learnt from BGP Peer

Bug #1463613 reported by Nischal Sheth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.20
Fix Committed
Medium
Nischal Sheth
Trunk
Fix Committed
Medium
Nischal Sheth

Bug Description

There's a corner case during BgpServer shutdown which could
result in stale/leftover BGP VPN routes, which ultimately causes
an assertion when the BGP Peer which advertised those routes is
deleted.

The problem happens only if family route-target is negotiated on
the BGP Peer. If the BgpServer is shut down after the BGP Peer is
established, but before the EndOfRibMarker for the route-target
family is received, then the VPN routes received from that peer do
not get deleted.

This happens because the BGP Peer is not properly registered (in
the membership manager) to any VPN tables before EndOfRib is
received. However, we do process and install BGP routes that we
receive from the peer. During peer close, membership manager
only deletes routes from tables to which the peer is registered.

Nischal Sheth (nsheth)
summary: - Race condition in deleting VPN routes from BGP Peers
+ Race condition in deleting VPN routes learnt from BGP Peer
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/11440
Submitter: Nischal Sheth (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.20

Review in progress for https://review.opencontrail.org/11441
Submitter: Nischal Sheth (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/11440
Committed: http://github.org/Juniper/contrail-controller/commit/54baf089a9b7fe99666e6e2fabbeb80b7ffd82cb
Submitter: Zuul
Branch: master

commit 54baf089a9b7fe99666e6e2fabbeb80b7ffd82cb
Author: Nischal Sheth <email address hidden>
Date: Tue Jun 9 13:39:33 2015 -0700

Fix concurrency issue in deleting VPN routes for BgpPeer

If routes received from a BgpPeer get installed and the BgpServer
is shut down before EndOfRib for family route-target is received
from the peer, the routes in question do not get deleted. This in
turn causes an assertion to fail when destroying the BgpPeer.

Fix is to register the BgpPeer for ribin to all VPN tables as soon
as the peer is established i.e. without waiting for EndOfRib for
family route-target to arrive. Ribout registration for VPN tables
happens only after EndOfRib if received.

Change-Id: I28652e7635a6453d5626ec55a781dfa778838411
Partial-Bug: 1463613

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/11441
Committed: http://github.org/Juniper/contrail-controller/commit/341c69db3f34eab6e26f330125a3b94ac632f3a4
Submitter: Zuul
Branch: R2.20

commit 341c69db3f34eab6e26f330125a3b94ac632f3a4
Author: Nischal Sheth <email address hidden>
Date: Tue Jun 9 13:39:33 2015 -0700

Fix concurrency issue in deleting VPN routes for BgpPeer

If routes received from a BgpPeer get installed and the BgpServer
is shut down before EndOfRib for family route-target is received
from the peer, the routes in question do not get deleted. This in
turn causes an assertion to fail when destroying the BgpPeer.

Fix is to register the BgpPeer for ribin to all VPN tables as soon
as the peer is established i.e. without waiting for EndOfRib for
family route-target to arrive. Ribout registration for VPN tables
happens only after EndOfRib if received.

Change-Id: I28652e7635a6453d5626ec55a781dfa778838411
Partial-Bug: 1463613

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/11538
Submitter: Nischal Sheth (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.20

Review in progress for https://review.opencontrail.org/11539
Submitter: Nischal Sheth (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/11538
Committed: http://github.org/Juniper/contrail-controller/commit/f229bdd9af5fc74c147f5ecb332115cc1dd98666
Submitter: Zuul
Branch: master

commit f229bdd9af5fc74c147f5ecb332115cc1dd98666
Author: Nischal Sheth <email address hidden>
Date: Wed Jun 10 09:29:06 2015 -0700

Refine memebership callback and vpn table registration

Change-Id: I40c07599a57f26c7ff7a860e2612ad1c11d2cc6b
Closes-Bug: 1463613

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/11539
Committed: http://github.org/Juniper/contrail-controller/commit/b80d8dfd19a7681e61bbba4e7cb2d878a05a9ea8
Submitter: Zuul
Branch: R2.20

commit b80d8dfd19a7681e61bbba4e7cb2d878a05a9ea8
Author: Nischal Sheth <email address hidden>
Date: Wed Jun 10 09:29:06 2015 -0700

Refine memebership callback and vpn table registration

Change-Id: I40c07599a57f26c7ff7a860e2612ad1c11d2cc6b
Closes-Bug: 1463613

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.