commit 176c5c8a65efbde01020bc69a97bb7d05720589e
Author: Jay Pipes <email address hidden>
Date: Mon Dec 12 16:39:23 2016 -0500
Only return latest instance fault for instances
This patch addresses slowness that can occur when doing a list servers
API operation when there are many thousands of records in the
instance_faults table.
Previously, in the Instance.fill_faults() method, we were getting all
instance fault records for a set of instances having one of a set of
supplied instance UUIDs and then iterating over those faults and
returning a dict of instance UUID to the first fault returned (which
happened to be the latest fault because of ordering the SQL query by
created_at).
This patch adds a new InstanceFaultList.get_latest_by_instance_uuids()
method that does some SQL-fu to only return the latest fault records for
each instance being inspected.
Closes-Bug: #1632247
Co-Authored-By: Roman Podoliaka <email address hidden>
Change-Id: I8f2227b3969791ebb2d04d74a316b9d97a4b1571
Reviewed: https:/ /review. openstack. org/409943 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=176c5c8a65e fbde01020bc69a9 7bb7d05720589e
Committed: https:/
Submitter: Jenkins
Branch: master
commit 176c5c8a65efbde 01020bc69a97bb7 d05720589e
Author: Jay Pipes <email address hidden>
Date: Mon Dec 12 16:39:23 2016 -0500
Only return latest instance fault for instances
This patch addresses slowness that can occur when doing a list servers
API operation when there are many thousands of records in the
instance_faults table.
Previously, in the Instance. fill_faults( ) method, we were getting all
instance fault records for a set of instances having one of a set of
supplied instance UUIDs and then iterating over those faults and
returning a dict of instance UUID to the first fault returned (which
happened to be the latest fault because of ordering the SQL query by
created_at).
This patch adds a new InstanceFaultLi st.get_ latest_ by_instance_ uuids()
method that does some SQL-fu to only return the latest fault records for
each instance being inspected.
Closes-Bug: #1632247
Co-Authored-By: Roman Podoliaka <email address hidden> ebb2d04d74a316b 9d97a4b1571
Change-Id: I8f2227b3969791