Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Routeorch] Fix next hop group reference count in bulk operation (son…
…ic-net#1501) What I did Remove next-hop groups after updating the reference counter for a bulk of routes instead of removing next-hop groups in the loop of updating the reference counter. Fix sonic-net#5813 Why I did it The bulk route API has two loops of updating the reference counter: 1. update the sairedis reference counter 2. update the orchagent reference counter Before this commit, the removal of next-hop groups is triggered in the second loop of updating the orchagent reference counter when the reference counter decreases to zero. This may result in a reference counter mismatch between orchagent and sairedis since the sairedis reference counter has already included the operation of the whole bulk but the orchagent reference counter has not. Therefore, the removal of next-hop group may fail due to the mismatch in reference counter (e.g., there are some other routes point to the next-hop group but has not been counted in orchagent yet). To fix this problem, the next-hop group removal operation should be done after updating the reference counter of the whole bulk to make sure the reference counters sairedis and orchagent matches.
- Loading branch information