Some resource's infos are incorrect when list resources of stack

Bug #1480183 reported by huangtianhua
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
huangtianhua

Bug Description

1. create a stack enable rollback
2. the stack create failed, and rollback complete, the resources has been deleted
3. stack-show, the stack is in ROLLBACK_COMPLETE
4. to list resources of the stack, some information of resource such as updated_time, creation_time and status are incorrect, the result like this:

root@monasca:/usr/hth# heat resource-list feee80bc-67b2-4582-99ce-c008f34b35c2
+---------------+----------------------+--------------------+-----------------+----------------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+---------------+----------------------+--------------------+-----------------+----------------------------+
| cv | | OS::Cinder::Volume | INIT_COMPLETE | 2015-07-31T09:03:59.041671 |
+---------------+----------------------+--------------------+-----------------+----------------------------+

5. The resource's state is wrong, should be DELETE_COMPLETE or ROLLBACK_COMPLETE, and the creation_time and updated_time should not be utcnow; Even should not return the resources which have been deleted.

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
summary: - resource's state incorrect when list resources of stack
+ Some resource's infos are incorrect when list resources of stack
description: updated
Changed in heat:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Yingzhe Zeng (zengyingzhe) wrote :

I met this bug too, and I've analyzed the cause of this bug preliminarily.
The resource records in DB will be deleted when stack rollbacks.
So when listing resources of rollbacking stack, some resources will just have initialized properties which are initialized by resource.__init__, such as status, updated_time, because can't find resource infos in DB.
The code referred to as follow, which is at the end of resource.__init__:

    resource = stack.db_resource_get(name)
    if resource:
        self._load_data(resource)

Hope this can provide some help.

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

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

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

commit 6c477034cc0d078db8c17613e9e3cc657713f6c1
Author: huangtianhua <email address hidden>
Date: Mon Aug 3 16:13:25 2015 +0800

    Fix incorrect resource's information while describing

    We can't get the resource'infos from db once the resource
    is deleted. All information of a deleted resource come
    from the initialization. So this change will modify some
    infos when resource init:
    1. set the action of resource to stack'action
    2. set the created_time to stack's created_time
    3. set the updated_time to stack's updated_time

    Then the information will be reset for normal resources.

    Change-Id: Iafdc99c572c5dab06bf1843842ed47554d6de128
    Closes-Bug: #1480183

Changed in heat:
status: In Progress → Fix Committed
Changed in heat:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-3 → 5.0.0
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.