resource object always loads properties data

Bug #1665503 reported by Crag Wolfe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Zane Bitter

Bug Description

Every time a resource object is loaded, an additional db query is made to load its resource_properties_data, if any. Certainly, there are cases where we don't care about the properties_data, e.g. describe_stack_resources.

For those cases we are sure we need the properties data, it ought to be eager loaded instead.

Crag Wolfe (cwolfe)
Changed in heat:
assignee: nobody → Crag Wolfe (cwolfe)
Rico Lin (rico-lin)
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
milestone: none → pike-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/447843

Changed in heat:
status: Triaged → In Progress
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-1 → pike-2
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-2 → pike-3
Changed in heat:
assignee: Crag Wolfe (cwolfe) → Zane Bitter (zaneb)
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-3 → pike-rc1
Rabi Mishra (rabi)
Changed in heat:
milestone: pike-rc1 → pike-rc2
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-rc2 → queens-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/447843
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=705625cee79a566ad5f13b0969a5b2b58f118987
Submitter: Jenkins
Branch: master

commit 705625cee79a566ad5f13b0969a5b2b58f118987
Author: Crag Wolfe <email address hidden>
Date: Tue Mar 21 01:52:50 2017 -0400

    Eager load resource_properties_data in resource

    Eager load resource_properties_data in resources in the typical
    resource-loading scenarios where properties data will be
    accessed. Thus, we can save an extra db query per resource when
    loading all the resources in a stack, for instance. Fall back to lazy
    loading properties data in other scenarios.

    Also, the resource object doesn't need to store a copy of its
    ResourcePropertiesData object in self.rsrc_prop_data, so don't.

    Change-Id: Ib7684af3fe06f818628fd21f1216de5047872948
    Closes-Bug: #1665503

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 10.0.0.0b1

This issue was fixed in the openstack/heat 10.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/521643

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat (master)

Reviewed: https://review.openstack.org/521643
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=dbc852b47a9a6a1044dd2a554f16f27681dbe762
Submitter: Zuul
Branch: master

commit dbc852b47a9a6a1044dd2a554f16f27681dbe762
Author: Zane Bitter <email address hidden>
Date: Mon Nov 20 13:59:19 2017 -0500

    Eager-load properties for nested resource list

    When doing "openstack stack resource list --nested-depth=n", we were
    lazy-loading the resources' properties data. This is expensive, especially
    when there are a large number of resources. Eager-load the data, as we
    always use it to show the resources.

    For consistency, always eager-load the resource 'data' (even in
    resource_get), because the Resource versioned object accesses it
    unconditionally.

    Change-Id: Idb871fddf77bf24828878c315e19e200c28841be
    Related-Bug: #1665503

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.