Comment 2 for bug 1482277

Revision history for this message
Prakash Bailkeri (prakashmb) wrote : Re: Rapid network create and delete causes a race condition

Root cause:
When the routing instance is deleted, route path replicator walks the route table as part of Leave of rtgroup in import and export Route targets. During the walk, it deletes all the replicated path/routes. On walk complete, it unregisters from the DBTable.
In the static route scenario, the static route is added on the internal routing instance that has "static-route-entries" property attached to it. Such generated static route is replicated to destination VRF based on "route-target-list" config in "static-route-entries. Note: such internal routing instance doesn't have these route targets in its export_rt.

If this internal routing instance is deleted, route path replicator starts the table walk as part of Leave of RtGroup in import and export. In case static route module has not processed the config delete of static route entries, it would not have deleted the static route added to inet route table. On walk complete, it would unregister from the routing table. Hence the replicated routes of Static route will never be deleted as RouteReplicator module is no longer TableListener and doesn't process delete of StaticRoute which happens when static route module process the delete request.

Proposed fix: (Testing)
Routereplicator to keep track of replicated routes/dbstate added, and unregister from DBTable only after all DBStates are clear (or after all replicated routes from this table is deleted).