Old value in 'updated_at' field returned after resource was changed

Bug #1281638 reported by Yuriy Zveryanskyy
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Galyna Zholtkevych

Bug Description

yura@test-0:~$ ironic node-update 4f7a91d9-cc4e-4cd4-90e4-4648fb2519ae add extra/foo=baz
+------------------------+--------------------------------------+
| Property | Value |
+------------------------+--------------------------------------+
| chassis_uuid | None |
| created_at | 2014-02-18T15:52:20+00:00 |
| driver | fake |
| driver_info | {} |
| extra | {u'foo': u'baz'} | <- new values here
| instance_uuid | None |
| last_error | None |
| power_state | None |
| properties | {} |
| provision_state | None |
| reservation | None |
| target_power_state | None |
| target_provision_state | None |
| updated_at | None | <- wrong
| uuid | 4f7a91d9-cc4e-4cd4-90e4-4648fb2519ae |
+------------------------+--------------------------------------+

Revision history for this message
Xurong Yang (idopra) wrote :

Hi,Doing the test and this can't be reproducted in latest version.So I think it has been fixed.
ironic node-update bf205c84-c5ca-4bd6-adeb-ae7f1fb25f8a add extra/foo=baz
+------------------------+--------------------------------------+
| Property | Value |
+------------------------+--------------------------------------+
| chassis_uuid | 10592f8c-2e77-4f03-9542-e01cf37c4d4c |
| created_at | 2014-02-19T06:15:55+00:00 |
| driver | fake |
| driver_info | {} |
| extra | {u'foo': u'baz'} |
| instance_uuid | None |
| last_error | None |
| power_state | None |
| properties | {} |
| provision_state | None |
| reservation | None |
| target_power_state | None |
| target_provision_state | None |
| updated_at | 2014-02-19T06:18:15+00:00 | --ok
| uuid | bf205c84-c5ca-4bd6-adeb-ae7f1fb25f8a |
+------------------------+--------------------------------------+

Changed in ironic:
status: New → Invalid
Revision history for this message
Yuriy Zveryanskyy (yzveryanskyy) wrote :

Reproduced for port in latest version, and for chassis the same

yura@test-0:~$ ironic port-update 8397eede-d539-4f38-9e37-273060bd444a add extra/foo=bar
+------------+--------------------------------------+
| Property | Value |
+------------+--------------------------------------+
| address | aa:bb:cc:dd:ee:ff |
| created_at | 2014-02-19T09:51:42+00:00 |
| extra | {u'foo': u'bar'} |
| node_uuid | 02128c23-ddf4-4bea-a264-88569c0100e4 |
| updated_at | None |
| uuid | 8397eede-d539-4f38-9e37-273060bd444a |
+------------+--------------------------------------+

Changed in ironic:
status: Invalid → New
Revision history for this message
Yuriy Zveryanskyy (yzveryanskyy) wrote :

Hi Xurong Yang

your updated_at probably result of sync_power_states periodic task

I disable this task and reproduce for node again in latest version

yura@test-0:~$ ironic node-create -d fake
+--------------+--------------------------------------+
| Property | Value |
+--------------+--------------------------------------+
| chassis_uuid | None |
| driver | fake |
| driver_info | {} |
| extra | {} |
| properties | {} |
| uuid | 89bfb2cf-926f-4a36-96b2-939089d409ea |
+--------------+--------------------------------------+
yura@test-0:~$ ironic node-update 89bfb2cf-926f-4a36-96b2-939089d409ea add extra/foo=bar
+------------------------+--------------------------------------+
| Property | Value |
+------------------------+--------------------------------------+
| chassis_uuid | None |
| created_at | 2014-02-19T10:13:04+00:00 |
| driver | fake |
| driver_info | {} |
| extra | {u'foo': u'bar'} |
| instance_uuid | None |
| last_error | None |
| power_state | None |
| properties | {} |
| provision_state | None |
| reservation | None |
| target_power_state | None |
| target_provision_state | None |
| updated_at | None |
| uuid | 89bfb2cf-926f-4a36-96b2-939089d409ea |
+------------------------+--------------------------------------+

Changed in ironic:
assignee: nobody → Mikhail Durnosvistov (mdurnosvistov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

Changed in ironic:
status: New → In Progress
aeva black (tenbrae)
Changed in ironic:
importance: Undecided → Wishlist
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ironic (master)

Change abandoned by Mike Durnosvistov (<email address hidden>) on branch: master
Review: https://review.openstack.org/75430

Revision history for this message
Dmitry Tantsur (divius) wrote :

Mikhail, is it correct to assume you no longer work on this bug?

Revision history for this message
Mike Durnosvistov (glacierrdev) wrote :

Dmitry, yep!

Changed in ironic:
assignee: Mike Durnosvistov (mdurnosvistov) → nobody
Dmitry Tantsur (divius)
Changed in ironic:
status: In Progress → Triaged
Rakesh H S (rh-s)
Changed in ironic:
assignee: nobody → Rakesh H S (rh-s)
Rakesh H S (rh-s)
Changed in ironic:
assignee: Rakesh H S (rh-s) → nobody
Anusha (anusha-iiitm)
Changed in ironic:
assignee: nobody → Anusha (anusha-iiitm)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

Changed in ironic:
status: Triaged → In Progress
Changed in ironic:
assignee: Anusha (anusha-iiitm) → Ramakrishnan G (rameshg87) (rameshg87)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/211849
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=1f4680ab23f531d052935d1ee1b73972406e2653
Submitter: Jenkins
Branch: master

commit 1f4680ab23f531d052935d1ee1b73972406e2653
Author: Anusha Ramineni <email address hidden>
Date: Wed Aug 12 10:44:31 2015 +0530

    'updated_at' field shows old value after resource is saved

    chassis.save() and port.save() doesn't update object from db
    because of which 'updated_at' field for the object
    is not up-to-date after a save(). This commit fixes this issue.

    Partial-Bug:#1281638
    Change-Id: I98af458e95f7ed3c787a9bcf2550f89e471ccd21

Revision history for this message
Dmitry Tantsur (divius) wrote :

Hi! I see some fixes got merged, is it still a valid bug?

Changed in ironic:
status: In Progress → Incomplete
assignee: Ramakrishnan G (rameshg87) (rameshg87) → nobody
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

I can confirm this is still valid for nodes but not for chassis or ports anymore: http://paste.openstack.org/show/576177/

Changed in ironic:
status: Incomplete → Confirmed
importance: Wishlist → Medium
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
Changed in ironic:
assignee: Lucas Alvares Gomes (lucasagomes) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

Changed in ironic:
assignee: nobody → Kyrylo Romanenko (kromanenko)
status: Confirmed → In Progress
Revision history for this message
Yuriy Zveryanskyy (yzveryanskyy) wrote :

Correct "updated_at" value is important for notifications payloads.

Changed in ironic:
assignee: Kyrylo Romanenko (kromanenko) → Galyna Zholtkevych (gzholtkevych)
Changed in ironic:
assignee: Galyna Zholtkevych (gzholtkevych) → Kyrylo Romanenko (kromanenko)
Changed in ironic:
assignee: Kyrylo Romanenko (kromanenko) → Galyna Zholtkevych (gzholtkevych)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/371605
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=065326c0f55a73c99706148f7bfbbec87ea863bc
Submitter: Jenkins
Branch: master

commit 065326c0f55a73c99706148f7bfbbec87ea863bc
Author: Kyrylo Romanenko <email address hidden>
Date: Fri Sep 16 18:00:43 2016 +0300

    'updated_at' field value after node is updated

    node.save() doesn't update object from db because 'updated_at'
    field for the node is not up-to-date after a save().

    Change-Id: I58076d71e5977dded3f5485f295b3235d467872d
    Partial-Bug: #1281638
    Co-Authored-By: Galyna Zholtkevych <email address hidden>

Revision history for this message
Yuriy Zveryanskyy (yzveryanskyy) wrote :

Problem mentioned in bug description fixed.

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

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

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

Reviewed: https://review.openstack.org/452930
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=62c6377adf5c3400834b29667cbf5e29e0e8bde6
Submitter: Jenkins
Branch: master

commit 62c6377adf5c3400834b29667cbf5e29e0e8bde6
Author: Ruby Loo <email address hidden>
Date: Mon Apr 3 16:24:46 2017 -0400

    Node should reflect what was saved

    After a node is saved to the database, we weren't updating the
    Node object to reflect what was saved. This caused a problem
    where the node's update_at field was incorrect. It was fixed
    in 065326c0f55a73c99706148f7bfbbec87ea863bc by explicitly
    setting node.update_at. However, that doesn't address other
    node fields that may be out of sync.

    The more correct fix would be to do a similar thing that (most
    of) the other Objects do, which is for the node to update itself
    via ._from_db_object().

    Doing this revealed several incorrect tests and code in the conductor
    and agent where changes to the node's dictionaries were incorrectly
    being set and thus, not being saved. Those are fixed in this patch.

    Change-Id: Ia84cd60c1a4eabcc1ad0a756124c338fa9f644c8
    Closes-Bug: #1679297
    Related-Bug: #1281638

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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