[RFE] Make agent_last_heartbeat a datetime field

Bug #1602410 reported by Mario Villaplana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Wishlist
Mario Villaplana

Bug Description

When using an agent driver, the agent_last_heartbeat field from driver_internal_info in the nodes table in the database, which indicates the last time that an agent sent a heartbeat to ironic, is an integer indicating seconds since epoch time: https://github.com/openstack/ironic/blob/8006ec8a519fdbb34e310e785d7647ee94f68c49/ironic/drivers/modules/agent_base_vendor.py#L464

This is not consistent with other top-level ironic fields that use actual datetime fields, such as provision_updated_at.

Having a datetime field in the driver_internal_info JSON for agent_last_heartbeat would improve consistency between different fields representing timestamps, make it easier for operators to read and use the timestamps without converting them from epoch time, and make it easier for downstream tooling to use the field.

IRC discussion about this issue is here: http://eavesdrop.openstack.org/irclogs/%23openstack-ironic/%23openstack-ironic.2016-07-12.log.html#t2016-07-12T20:01:33

Tags: rfe-approved
Changed in ironic:
assignee: nobody → Mario Villaplana (mario-villaplana-j)
Sam Betts (sambetts)
summary: - agent_last_heartbeat type not consistent with other date fields
+ [RFE] Make agent_last_heartbeat a datetime field
Changed in ironic:
importance: Undecided → Wishlist
tags: added: rfe
Changed in ironic:
status: New → Confirmed
Revision history for this message
Jim Rollenhagen (jim-rollenhagen) wrote :

Going by irc discussion, this seems fine, should make a new name for it and phase it out over a cycle. Approved.

tags: added: rfe-approved
removed: rfe
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/376978

Changed in ironic:
status: Confirmed → In Progress
Revision history for this message
Mario Villaplana (mario-villaplana-j) wrote :

After some discussion, we've decided that it's better to just remove this attribute and add a release note about it, since it's completely unused by ironic and just used to log a helpful message.

discussion: http://eavesdrop.openstack.org/irclogs/%23openstack-ironic/%23openstack-ironic.2016-10-13.log.html#t2016-10-13T21:30:53

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

Reviewed: https://review.openstack.org/376978
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=7dc74ab75478318afc5c933472423f4c77eb662d
Submitter: Jenkins
Branch: master

commit 7dc74ab75478318afc5c933472423f4c77eb662d
Author: Mario Villaplana <email address hidden>
Date: Mon Sep 26 17:48:58 2016 +0000

    Remove "agent_last_heartbeat" internal field from agent drivers

    "agent_last_heartbeat" in the driver_internal_info dict of agent drivers is not
    used anywhere by ironic itself, except for logging purposes. This
    removes it.

    Change-Id: Ic198f6a952ed135099bcc525ef548a4aea005056
    Closes-Bug: 1602410

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

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

Reviewed: https://review.openstack.org/387652
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=128c025fc10e315df486729becdb9cd04b0c5f1e
Submitter: Jenkins
Branch: master

commit 128c025fc10e315df486729becdb9cd04b0c5f1e
Author: Ruby Loo <email address hidden>
Date: Mon Oct 17 15:37:50 2016 -0400

    Remove 'agent_last_heartbeat' from node.driver_internal_info

    node.driver_internal_info['agent_last_heartbeat'] was not being used by
    ironic, and Ic198f6a952ed135099bcc525ef548a4aea005056 removed the code
    that sets that value.

    However, for existing nodes, driver_internal_info['agent_last_heartbeat']
    may already exist, so we need to delete it. This patch does that.

    In addition, a LOG line was moved (and a nit addressed) to make the code
    a bit easier to read.

    This is a followup to Ic198f6a952ed135099bcc525ef548a4aea005056.

    Change-Id: I194d22c0e605b187823ceebae94d3ef895fb91f5
    Related-Bug: #1602410

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic 7.0.0

This issue was fixed in the openstack/ironic 7.0.0 release.

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.