(perf) Unnecessarily joining instance.services when listing instances regardless of microversion

Bug #1719460 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Andrey Volkov
Pike
Confirmed
Medium
Unassigned
Queens
Fix Committed
Medium
Matt Riedemann

Bug Description

Microversion 2.16 adds the ability to show the host status of an instance when listing servers with details or showing a single server's details. By default that is only shown for an admin.

Change https://review.openstack.org/#/c/355558/ helped improve the performance for this by avoiding lazy-loading the instance.services column by doing the join in the DB API when querying the instances from the database.

However, that check is not based on version 2.16, like the 2.26 tags check below it.

This means that we are unnecessarily joining with the services table when querying instances with microversions < 2.16, which happens, for example, by default in the openstack CLI which uses microversion 2.1.

We arguably should make this also conditional on policy so we don't join for non-admins by default, but that's less of an issue probably as non-admins probably aren't listing thousands of instances from the deployment like an admin would.

Matt Riedemann (mriedem)
summary: - instance.services loading when listing instances regardless of
- microversion
+ (perf) Unnecessarily joining instance.services when listing instances
+ regardless of microversion
Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in nova:
assignee: nobody → Andrey Volkov (avolkov)
Changed in nova:
assignee: Andrey Volkov (avolkov) → jichenjc (jichenjc)
status: Triaged → In Progress
Changed in nova:
assignee: jichenjc (jichenjc) → Matt Riedemann (mriedem)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Matt Riedemann (mriedem) → nobody
assignee: nobody → Andrey Volkov (avolkov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/507854
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a0b4116ed68cb71a9a74fee616b5036f5fda4dd2
Submitter: Zuul
Branch: master

commit a0b4116ed68cb71a9a74fee616b5036f5fda4dd2
Author: Andrey Volkov <email address hidden>
Date: Wed Sep 27 09:40:22 2017 +0300

    List instances performace optimization

    Join service table for microversion starting 2.16 only
    so only include service from 2.16 version.

    Co-Authored-By: jichenjc <email address hidden>

    Closes-Bug: 1719460

    Change-Id: I6c57fa013ee8f6d064fc747906e1234a0aa3e8c2

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/561715

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

Reviewed: https://review.openstack.org/561715
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9cb96ab9319aea2e63c0c67cab9e5d92638bfcb2
Submitter: Zuul
Branch: stable/queens

commit 9cb96ab9319aea2e63c0c67cab9e5d92638bfcb2
Author: Andrey Volkov <email address hidden>
Date: Wed Sep 27 09:40:22 2017 +0300

    List instances performace optimization

    Join service table for microversion starting 2.16 only
    so only include service from 2.16 version.

    Co-Authored-By: jichenjc <email address hidden>

    Closes-Bug: 1719460

    Change-Id: I6c57fa013ee8f6d064fc747906e1234a0aa3e8c2
    (cherry picked from commit a0b4116ed68cb71a9a74fee616b5036f5fda4dd2)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.0.0.0b1

This issue was fixed in the openstack/nova 18.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.3

This issue was fixed in the openstack/nova 17.0.3 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.