Public bug reported:
Affected version: 2024.1 (Caracal), possibly other versions too
When sorting instances in Horizon under Admin → Compute → Instances,
clicking a column header (e.g. Name) sorts only the instances displayed
on the current page, rather than sorting the complete instance list.
As a result, instances are not displayed in alphabetical order across
multiple pages, making it difficult to locate specific instances in
environments containing many VMs.
Steps to reproduce
1. Log in to Horizon as an administrator.
2. Navigate to Admin → Compute → Instances.
3. Ensure there are enough instances to span multiple pages (e.g. more than 20).
4. Click the Instance Name column header to sort alphabetically.
5. Navigate to the next page.
Expected result
All instances should be sorted globally by the selected column before
pagination, ensuring alphabetical ordering is maintained across all
pages.
Actual result
Only instances on the currently displayed page are sorted. Navigating
between pages reveals that the overall instance list is not sorted
alphabetically.
Root cause analysis
The behavior appears to result from combining server-side pagination
with client-side table sorting.
In Horizon 2024.1:
openstack_dashboard/dashboards/admin/instances/views.py:
AdminIndexView.get_data() retrieves paginated instances using
api.nova.server_list_paged().
openstack_dashboard/api/nova.py: Instance retrieval uses created_at,
display_name, and uuid as sorting keys, with creation date taking
precedence.
horizon/static/horizon/js/horizon.tables.js: Column-header sorting is
implemented using jQuery TableSorter, which sorts only the rows
currently present in the HTML table.
Consequently, selecting a column header does not trigger a backend query
with the selected sorting parameters.
Suggested fix
Implement server-side sorting for paginated instance tables, passing the
selected sorting column and direction to the backend before retrieving
the requested page.
Additional information
The same behavior has also been observed in other Horizon tables
containing more than 20 entries, suggesting this may affect multiple
paginated views.
** Affects: horizon (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174591
Title:
Sorting instances by name only affects the current page, not the
entire instance list
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/horizon/+bug/2174591/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs