<html><body>
<p><tt><font size="2">Vishvananda Ishaya <vishvananda@gmail.com> wrote on 01/27/2015 04:29:50 PM:<br>
<br>
> From: Vishvananda Ishaya <vishvananda@gmail.com></font></tt><br>
<tt><font size="2">> To: "OpenStack Development Mailing List (not for usage questions)" <br>
> <openstack-dev@lists.openstack.org></font></tt><br>
<tt><font size="2">> Date: 01/27/2015 04:32 PM</font></tt><br>
<tt><font size="2">> Subject: Re: [openstack-dev] [nova] [api] Get servers with limit and<br>
> IP address filter</font></tt><br>
<tt><font size="2">> <br>
> The network info for an instance is cached as a blob of data <br>
> (neutron has the canonical version in most installs), so it isn’t <br>
> particularly easy to do at the database layer. You would likely need<br>
> a pretty complex stored procedure to do it accurately.</font></tt><br>
<tt><font size="2">> <br>
> Vish</font></tt><br>
<br>
<tt><font size="2">Vish,</font></tt><br>
<br>
<tt><font size="2">Thanks for the reply.</font></tt><br>
<br>
<tt><font size="2">I agree with your point about the difficultly in accurately querying the blob of data; however, IMHO, the complexity this fix does not </font></tt><tt><font size="2">preclude the current behavior as being classified as a bug.</font></tt><br>
<br>
<tt><font size="2">With that in mind, I was wondering if anyone in the community has any thoughts on if the current behavior is considered a bug?</font></tt><br>
<br>
<tt><font size="2">If so, how should it be resolved? A couple options that I could think of:</font></tt><br>
<br>
<tt><font size="2">1. Disallow the combination of using both a limit and an IP address filter by raising an error.</font></tt><br>
<tt><font size="2">2. Workaround the problem by removing the limit from the DB query and then manually limiting the list of servers (after manually applying the IP address filter).</font></tt><br>
<tt><font size="2">3. Break up the query so that the server UUIDs that match the IP filter are retrieved first and then used as a UUID DB filter. As far as I can tell, this type of solution was originally implemented but the network query was deemed to expensive [1]. Is there a less expensive method to determine the UUIDs (possibly querying the cached 'network_info' in the '</font></tt><tt><font size="2">instance_info_caches' table)?</font></tt><br>
<tt><font size="2">4. Figure out how to accurately query the blob of network info that is cached in the nova DB and apply the IP filter at the DB layer.</font></tt><br>
<br>
<tt><font size="2">[1]: </font></tt><a href="https://review.openstack.org/#/c/131460/"><tt><font size="2">https://review.openstack.org/#/c/131460/</font></tt></a><br>
<br>
<tt><font size="2">Thanks,</font></tt><br>
<tt><font size="2">Steven Kaufer</font></tt><br>
<br>
<tt><font size="2">> <br>
> On Jan 27, 2015, at 2:00 PM, Steven Kaufer <kaufer@us.ibm.com> wrote:</font></tt><br>
<tt><font size="2">> <br>
> Hello,<br>
> <br>
> When applying an IP address filter to a paginated servers query (eg,<br>
> supplying servers/detail?ip=192.168&limit=100), the IP address <br>
> filtering is only being applied against the non-filtered page of <br>
> servers that were retrieved from the DB; see [1].<br>
> <br>
> I believe that the IP address filtering should be done before the <br>
> limit is applied, returning up to <limit> servers that match the IP <br>
> address filter.  Currently, if the servers in the page of data <br>
> returned from the DB do not happen to match the IP address filter <br>
> (applied in the compute API), then no servers will be returned by <br>
> the REST API (even if there are servers that match the IP address filter).<br>
> <br>
> This seems like a bug to me, shouldn't all filtering be done at the DB layer?<br>
> <br>
> [1]: <a href="https://github.com/openstack/nova/blob/master/nova/compute/">https://github.com/openstack/nova/blob/master/nova/compute/</a><br>
> api.py#L2037-L2042<br>
> <br>
> Thanks,<br>
> Steven Kaufer</font></tt><br>
<tt><font size="2">> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe<br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></font></tt><br>
<tt><font size="2">> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe<br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</font></tt></body></html>