Race condition between route handling and VRF subscription
As part of fix for 1563550, fix for one corner case is missed.
Consider the case where
1. route add operation is enqueued to DB,
2. unsubscribe for the instance is received,
3. membership manager API to unregister table is called, membership managers
starts leave and part of the table is walked but membership manager has not
yet removed IPeerRib,
4. Route add request is processed and path gets added.
Fix:
1. Reset the subscription gen id when unregister request is handled. i.e.
before starting the walk. This will ensure that delayed route add is rejected.
2. Add UT cases to validate above mentioned scenario
Change-Id: Ic12259b852227c1f199a67611da49a3563010026
Closes-Bug: #1574169
(cherry picked from commit 315c60bca45710d8ef9de2bc0ff123316d9ea3db)
Reviewed: https:/ /review. opencontrail. org/19717 github. org/Juniper/ contrail- controller/ commit/ e62159cce888819 c0d67803466fc1a 5fead3db29
Committed: http://
Submitter: Zuul
Branch: R2.21.x
commit e62159cce888819 c0d67803466fc1a 5fead3db29
Author: Prakash Bailkeri <email address hidden>
Date: Tue Apr 26 16:33:41 2016 +0530
Race condition between route handling and VRF subscription
As part of fix for 1563550, fix for one corner case is missed.
Consider the case where
1. route add operation is enqueued to DB,
2. unsubscribe for the instance is received,
3. membership manager API to unregister table is called, membership managers
starts leave and part of the table is walked but membership manager has not
yet removed IPeerRib,
4. Route add request is processed and path gets added.
Fix:
1. Reset the subscription gen id when unregister request is handled. i.e.
before starting the walk. This will ensure that delayed route add is rejected.
2. Add UT cases to validate above mentioned scenario
Change-Id: Ic12259b852227c 1f199a67611da49 a3563010026 8ef9de2bc0ff123 316d9ea3db)
Closes-Bug: #1574169
(cherry picked from commit 315c60bca45710d