test_list_servers_filter_by_zero_limit fails with DB2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Matt Riedemann |
Bug Description
Tempest test test_list_
From the DB2 doc:
"The fetch-first-clause lets the database manager know that the application does not want to retrieve more than integer rows, regardless of how many rows there might be in the result table when this clause is not specified. An attempt to fetch beyond integer rows is handled the same way as normal end of data (SQLSTATE 02000). The value of integer must be a positive integer (not zero)."
Looking at the Nova API paginate collections docs:
http://
It doesn't say anything about lower bounds validation, only that over limit is a 413 HTTP error response. Otherwise the examples use limit=1.
There isn't really any point of allowing the query to get down into the DB API layer just to perform a query and then remove the results, so we should just detect limit == 0 in the nova API layer and just return an empty response.
Changed in nova: | |
assignee: | nobody → Matt Riedemann (mriedem) |
status: | New → Triaged |
Changed in nova: | |
milestone: | none → juno-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | juno-1 → 2014.2 |
Here is where nova API checks for request limit < 0:
https:/ /github. com/openstack/ nova/blob/ 2014.1. b3/nova/ api/openstack/ common. py#L210
and get_limit_ and_marker is used by the servers API:
https:/ /github. com/openstack/ nova/blob/ 2014.1. b3/nova/ api/openstack/ common. py#L222
https:/ /github. com/openstack/ nova/blob/ 2014.1. b3/nova/ api/openstack/ compute/ servers. py#L595
So it would be easy enough to just detect limit == 0 in the servers API (v2 and v3) and handle it there by returning instance_list = [].