"Updated" timestamps store the Wrong Thing

Bug #1193269 reported by Zane Bitter
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Low
andersonvom
Kilo
Fix Released
Undecided
Unassigned

Bug Description

We treat the "Update Time" as a "modification time". In the cfn API, the "Update Time" is actually supposed to be the last time an Update was done on the resource/stack (analagous to the "Create Time"), not the last time the object in the database was updated.

The modification time doesn't seem like a useful thing to have, so we should just use that field for the Update time. Bonus: there would probably no longer be any worries about having cached an old value (which prompted the code that caused bug #1193132).

Steven Hardy (shardy)
Changed in heat:
status: New → Triaged
milestone: none → havana-3
Changed in heat:
assignee: nobody → Lei Zhang (redheadflyundershadow)
Steven Hardy (shardy)
Changed in heat:
milestone: havana-3 → havana-rc1
Steven Hardy (shardy)
Changed in heat:
milestone: havana-rc1 → icehouse-1
Changed in heat:
milestone: icehouse-1 → icehouse-2
Changed in heat:
milestone: icehouse-2 → icehouse-3
Revision history for this message
Zane Bitter (zaneb) wrote :

No activity for 6 months, so reassigned to nobody so that someone might pick it up.

Changed in heat:
assignee: Lei Zhang (redheadflyundershadow) → nobody
Changed in heat:
milestone: icehouse-3 → none
Zane Bitter (zaneb)
Changed in heat:
assignee: nobody → andersonvom (andersonvom)
Revision history for this message
andersonvom (andersonvom) wrote :

Do we have an expected behavior for the following scenario?
- a stack has been created, but no update was issued. What's the updated_time?

IMO, this should be set to None and should be displayed as such, but it could be argued that this value should be the same as created_time for this specific case.

Any comments?

Revision history for this message
Steven Hardy (shardy) wrote :

IMO the updated time should be the same as the created time in that scenario

Revision history for this message
Randall Burt (randall-burt) wrote :

IMO, if we take Zane's argument that the "Updated Time" should reflect the last time a stack-update was successful, then it should be empty/none if that's never happened. We should probably mimic the CFN behavior, though at least for the CFN format/api. I don't have issues if this behavior is mirrored in Native/HOT, just to keep things simple.

Revision history for this message
Zane Bitter (zaneb) wrote :

I agree with Randall. It should be None in the DB. In the heat-cfn-api at least, it should be filtered out of the data returned to the user when it is None, because that's how CloudFormation works. In the native API we have the choice of explicitly reporting it as None/nil or filtering it out. I think I would marginally prefer the former, but do whatever is easier.

Changed in heat:
status: Triaged → In Progress
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/76644

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

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

commit ce690963e71e39eb9fd03377f420ff208aa7e3ed
Author: Richard Lee <email address hidden>
Date: Tue Feb 18 16:46:31 2014 -0500

    Change Stack timestamps to save correct info

    Stack.updated_time is currently being treated as modification time of
    the object in the database. Since it's not a very useful thing to have
    and the CFN API treats this value as "the last time an update call was
    issued", it makes sense to have the same behavior here as well.

    This changes the current real-time retrieval of created_time and
    updated_time in favor of the attributes already present in the stack and
    changes the information stored in these two fields to be the time the
    stack was created and the time the stack was last updated by the user,
    respectively.

    Co-Authored-By: Anderson Mesquita <email address hidden>
    Closes-Bug: #1193269
    Change-Id: I1fd6586b827b3f2babb5af5c85f9de25da74fbb6

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat (master)

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

commit cc1d2dddfbf6dbf57c2e836faa8b2b26433723dc
Author: Anderson Mesquita <email address hidden>
Date: Wed Feb 26 15:24:17 2014 -0500

    Change Resource timestamps to save correct info

    Resource.updated_time is currently being treated as modification time
    of the object in the database. Since it's not a very useful thing to
    have and the CFN API treats this value as "the last time an update
    call was issued", it makes sense to have the same behavior here as
    well.

    This changes the current real-time retrieval of created_time and
    updated_time in favor of the attributes already present in the
    resource and changes the information stored in these two fields to be
    the time the resource was created and the time the resource was last
    updated by the user, respectively.

    Co-Authored-By: Richard Lee <email address hidden>
    Related-Bug: #1193269
    Change-Id: Iad689b97d237fa63856b878827a1fcb1676c991c

Thierry Carrez (ttx)
Changed in heat:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-3 → 2014.1
Revision history for this message
Steven Hardy (shardy) wrote :

An interesting side-effect of this, it transpires, is that it's impossible to determine the time when a stack update started, ref bug #1448155, which makes filtering for events which happened since the current in-progress action started very difficult.

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.