Loading a resource object always loads all resource db fields

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

Bug Description

There are a few cases where a resource object is loaded when it is known that we won't actually need to access all of its fields (including those derived from other tables), but all of them are loaded anyway. There should be a way for consumers of heat.objects.resource.Resource to optionally only specify the fields they are interested in.

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/454415

Changed in heat:
assignee: nobody → Crag Wolfe (cwolfe)
status: New → In Progress
Zane Bitter (zaneb)
Changed in heat:
milestone: none → pike-2
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/454415
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=93fab308e8057ab95ca0e98a6515f2cf9648ed3e
Submitter: Jenkins
Branch: master

commit 93fab308e8057ab95ca0e98a6515f2cf9648ed3e
Author: Crag Wolfe <email address hidden>
Date: Thu Apr 6 21:49:40 2017 -0400

    Load "lighter" db resources when appropriate

    Sometimes we know we will only access particular fields of a resource
    object, rather than *all* of them. This commit allows the caller to
    specify (optionally) the fields that should be populated when the
    resource object is instantiated. This saves memory, trips to the db,
    and in some cases avoids extra join queries (e.g. for resource.data or
    resource.rsrc_prop_data).

    Change-Id: I405888f46451d2657aa28f610f8ca555215ff5cf
    Partial-Bug: #1680658

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/470942

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

Reviewed: https://review.openstack.org/470942
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=39f2aa0723b72668832f4c1eec3c31d18fb8cf74
Submitter: Jenkins
Branch: master

commit 39f2aa0723b72668832f4c1eec3c31d18fb8cf74
Author: rabi <email address hidden>
Date: Mon Jun 5 17:26:37 2017 +0530

    Load 'name' field for db resource

    I405888f46451d2657aa28f610f8ca555215ff5cf changed to load only
    a few fields when loading the resource from the db. We should
    load 'name' field for it to be used when rasing ConcurrentTransaction
    exception.

    Change-Id: I699961b75c7c417d03e21b51a2464c39e737ca89
    Related-Bug: #1583679
    Related-Bug: #1680658

Rico Lin (rico-lin)
Changed in heat:
milestone: pike-2 → pike-3
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-3 → pike-rc1
Zane Bitter (zaneb)
Changed in heat:
assignee: Crag Wolfe (cwolfe) → nobody
Rabi Mishra (rabi)
Changed in heat:
milestone: pike-rc1 → next
Revision history for this message
Zane Bitter (zaneb) wrote :

Not sure why this was marked as a partial fix, but I think we should call this fixed in Pike.

Changed in heat:
status: In Progress → Fix Released
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.