You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vcl.apache.org by "Mike Jennings (JIRA)" <ji...@apache.org> on 2017/11/13 16:46:00 UTC

[jira] [Commented] (VCL-1082) monitor_vcld.pl throws incorrect lastcheckin time exception after Daylight Savings Time Roles Back

    [ https://issues.apache.org/jira/browse/VCL-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16249810#comment-16249810 ] 

Mike Jennings commented on VCL-1082:
------------------------------------

This issue occurs because the monitor_vcld.pl program compares the epoch time returned form the management node operating system to the date/time value returned from the lastcheckin time on the managementnode table in the database which is converted from a datetime column value to epoch.  

The DATETIME column type stores date and time as a static value where the TIMESTAMP column is stored as a UTC and then converted for display based on the Local Timezone setting in mysql.  Because information is not stored in MySQL in a TIMESTAMP column there is no way for the monitor_vcld.pl program to know that the date and time being returned from MySQL has actually been rolled back a hour and things that the epoch time is one hour in the past.  

I have solved this issue, but changing the DATETIME value to TIMESTAMP in the database using the following query below.

ALTER TABLE managementnode MODIFY COLUMN lastcheckin TIMESTAMP;

I then modified the code to update the lastupdate time using the NOW() method, so that we use the current time of the database server when updating the timestamp.  I also modified the epoch timestamp check to return the lastmodified timestamp as a epoch value from MySQL  by leveraging the UNIX_TIMESTAMP function in MySQL.  This lets MySQL take care of managing daylights savings time and timezones for the system.

I am attaching a patch of the code changes that  I performed. 

> monitor_vcld.pl throws incorrect lastcheckin time exception after Daylight Savings Time Roles Back
> --------------------------------------------------------------------------------------------------
>
>                 Key: VCL-1082
>                 URL: https://issues.apache.org/jira/browse/VCL-1082
>             Project: VCL
>          Issue Type: Bug
>          Components: vcld (backend)
>    Affects Versions: 2.5
>            Reporter: Mike Jennings
>            Priority: Minor
>              Labels: patch
>
> When Daylight Savings time rolled back one hour on Nov 5th, the monitor_vcld.pl program started reporting critical exceptions where the management node has not been checked in, in over a hour.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)