yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #95831
[Bug 2110044] [NEW] GET /servers/details is not always returning the correct number of servers
Public bug reported:
Context
=======
Nova 2024.2 (but master seems affected)
For an unknown reason (yet), we had leftovers in our
nova_api/build_requests table:
MariaDB [nova_api]> select instance_uuid from build_requests;
+--------------------------------------+
| instance_uuid |
+--------------------------------------+
| 261bce67-29ec-4e09-a172-f9fca1daa60e |
... (maybe some others)
+--------------------------------------+
The thing is that this instance does exists on the infra:
$ openstack server show 261bce67-29ec-4e09-a172-f9fca1daa60e -c Id
+--------+--------------------------------------+
| Field | Value |
+--------+--------------------------------------+
| id | 261bce67-29ec-4e09-a172-f9fca1daa60e |
| status | ACTIVE |
+--------+--------------------------------------+
Issue
=====
Because it's in both build_requests and one of the nova cell, it's then
filtered by def _get_unique_filter_method [1] when requesting instances
with a limit:
$ curl -H "X-Auth-Token: $T" "http://nova.57.129.93.86.xip.opensteak.fr/v2.1/servers/detail?limit=7" | jq ".servers[].id" | wc -l
6
AND the marker for next page is missing (servers_links).
The servers_links is missing because def _get_collection_links is not
adding it if the number of object is lower than the limit [2] [3]
[1] https://github.com/openstack/nova/blob/a5bcaf69b1a80d4d02fe092900471a6e7a28e292/nova/compute/api.py#L3174-L3200
[2] https://github.com/openstack/nova/blob/a5bcaf69b1a80d4d02fe092900471a6e7a28e292/nova/api/openstack/compute/views/servers.py#L581
[3] https://github.com/openstack/nova/blob/a5bcaf69b1a80d4d02fe092900471a6e7a28e292/nova/api/openstack/common.py#L416
** Affects: nova
Importance: Undecided
Assignee: Arnaud Morin (arnaud-morin)
Status: In Progress
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2110044
Title:
GET /servers/details is not always returning the correct number of
servers
Status in OpenStack Compute (nova):
In Progress
Bug description:
Context
=======
Nova 2024.2 (but master seems affected)
For an unknown reason (yet), we had leftovers in our
nova_api/build_requests table:
MariaDB [nova_api]> select instance_uuid from build_requests;
+--------------------------------------+
| instance_uuid |
+--------------------------------------+
| 261bce67-29ec-4e09-a172-f9fca1daa60e |
... (maybe some others)
+--------------------------------------+
The thing is that this instance does exists on the infra:
$ openstack server show 261bce67-29ec-4e09-a172-f9fca1daa60e -c Id
+--------+--------------------------------------+
| Field | Value |
+--------+--------------------------------------+
| id | 261bce67-29ec-4e09-a172-f9fca1daa60e |
| status | ACTIVE |
+--------+--------------------------------------+
Issue
=====
Because it's in both build_requests and one of the nova cell, it's
then filtered by def _get_unique_filter_method [1] when requesting
instances with a limit:
$ curl -H "X-Auth-Token: $T" "http://nova.57.129.93.86.xip.opensteak.fr/v2.1/servers/detail?limit=7" | jq ".servers[].id" | wc -l
6
AND the marker for next page is missing (servers_links).
The servers_links is missing because def _get_collection_links is not
adding it if the number of object is lower than the limit [2] [3]
[1] https://github.com/openstack/nova/blob/a5bcaf69b1a80d4d02fe092900471a6e7a28e292/nova/compute/api.py#L3174-L3200
[2] https://github.com/openstack/nova/blob/a5bcaf69b1a80d4d02fe092900471a6e7a28e292/nova/api/openstack/compute/views/servers.py#L581
[3] https://github.com/openstack/nova/blob/a5bcaf69b1a80d4d02fe092900471a6e7a28e292/nova/api/openstack/common.py#L416
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2110044/+subscriptions