-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #17362: Fix unicity of VRF returned by filter_present_in_vrf function #17376
Fixes #17362: Fix unicity of VRF returned by filter_present_in_vrf function #17376
Conversation
…resent_in_vrf function
Thanks for this @pl0xym0r. Did you happen to try any alternative approaches to adjusting the queryset, specifically filtering for the VRF IDs separately and then passing them as a list for the base queryset. I'm curious what, if any, difference in performance that would have versus calling |
TBH, it seemed the easiest way to solve the issue and I didn't try to modify the code itself, nor took in mind any performance issue as |
FWIW addding
That's about a 33% slowdown in both cases. |
Seems like a reasonable fix IMO. We can investigate potential optimizations if need be in the future but this should at least resolve the bug. |
Fixes: #17362
.distinct() permits to remove unnecessary duplicated returns of the VRF passed in parameter in the function.
This permits to have unique IP and Prefixes when using
present_in_vrf
/present_in_vrf_id
parameter, example :For prefixes:
For IP: