Pagination bug for VRF's in the web UI and API #1869
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
Issue type
[ ] Feature request
[X] Bug report
[ ] Documentation
Environment
We have a lot of VRF's with the same name (don't ask :-() and if a group of such VRF's happens to span a page break, the web UI and API both can return the wrong thing when retrieving the list of VRF's. The problem appears to happen because the underlying SQL orders the VRF rows returned from the database by name only.
For example, if we have 5 VRF's called X, doing something like
SELECT * FROM vrf ORDER BY name
means that they must appear after all the W's and before all the Y's, but the ordering of the X's within themselves is undetermined. If these VRF's had RD's 1 through 5, and pagination was such that we want to show 3 of them on the first page and 2 on the second, for the first page, the database might return the X rows in ascending RD order, and we would see this:On the second page, another SQL query is issued, and since the database is free to return the X's in any order it pleases, they could come back in descending RD order, and so we would see this:
IOTW, X-1 and X-2 appear twice, and X-4 and X-5 are missing. This also happens when calling the API.
Changing
VRF.Meta.ordering
to be['name','rd']
clears the problem (presumably, this might be also happening elsewhere). I also checked the code for the v2.3-beta2 release you just pushed out, and it looks like the same thing will happen there as well.I see here that sorting RD's is problematic, but in this particular case, it doesn't matter what the sort order of the VRF's is, just that it's stable across queries.
The text was updated successfully, but these errors were encountered: