commit ef10d8d9a67855895f4ea9f9c49e1976b84e1547
Author: Matt Riedemann <email address hidden>
Date: Tue Jun 18 11:13:32 2019 -0400
Fix GET /servers/detail host_status performance regression
Change I82b11b8866ac82b05eae04351605d52fa8b91453 moved the
host_status extended server attribute processing from an
extension to the main servers view builder. This, however,
caused a regression in the detailed listing of servers because
it didn't incorporate the caching mechanism used previously
by the extension so now for each server with details when
microversion 2.16 or greater is used (and the request passes
the policy check), we get the host status per server even if
we have multiple servers on the same host.
This moves the host_status processing out of the show() method
when listing servers with details and processes them in aggregate
similar to security groups and attached volumes.
One catch is the show() method handles instances from down cells
for us so we have to handle that separately in the new host_status
processing, but it's trivial (just don't get host_status for
instances without a host field set).
NOTE(mriedem): This backport does not revert commit
0cecd2ac324dc9a20e7d60987b9ef6e5082c426d since that
change was only in Train.
Change-Id: I8278d4ea993ed1600919e34c9759600c8c7dbb41
Closes-Bug: #1830260
(cherry picked from commit ab7d923ae7ed4d7525649bc16ff012c1bedca0f5)
Reviewed: https:/ /review. opendev. org/669958 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=ef10d8d9a67 855895f4ea9f9c4 9e1976b84e1547
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit ef10d8d9a678558 95f4ea9f9c49e19 76b84e1547
Author: Matt Riedemann <email address hidden>
Date: Tue Jun 18 11:13:32 2019 -0400
Fix GET /servers/detail host_status performance regression
Change I82b11b8866ac82 b05eae04351605d 52fa8b91453 moved the
host_status extended server attribute processing from an
extension to the main servers view builder. This, however,
caused a regression in the detailed listing of servers because
it didn't incorporate the caching mechanism used previously
by the extension so now for each server with details when
microversion 2.16 or greater is used (and the request passes
the policy check), we get the host status per server even if
we have multiple servers on the same host.
This moves the host_status processing out of the show() method
when listing servers with details and processes them in aggregate
similar to security groups and attached volumes.
One catch is the show() method handles instances from down cells
for us so we have to handle that separately in the new host_status
processing, but it's trivial (just don't get host_status for
instances without a host field set).
NOTE(mriedem): This backport does not revert commit dc9a20e7d60987b 9ef6e5082c426d since that
0cecd2ac324
change was only in Train.
Change-Id: I8278d4ea993ed1 600919e34c97596 00c8c7dbb41 525649bc16ff012 c1bedca0f5)
Closes-Bug: #1830260
(cherry picked from commit ab7d923ae7ed4d7