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

Colin Patrick McCabe commented on HDFS-4117:
--------------------------------------------

The code treats checkpointAge "as if it were in milliseconds" because it *is* 
in milliseconds.

Check the documentaton for {{Time.now()}} and {{File#lastModified}}, used to 
calculate checkpointAge.
{code}
  /**
   * Current system time.  Do not use this to calculate a duration or interval
   * to sleep, because it will be broken by settimeofday.  Instead, use
   * monotonicNow.
   * @return current time in msec.
   */
  public static long now() {
    return System.currentTimeMillis();
  }
{code}

So basically the code does not need to be changed.

To avoid this kind of confusion in the future, it would be a good idea to add a 
comment specifying that {{dfs.namenode.checkpoint.period}} is in seconds.
                
> FSImage.needsResaveBasedOnStaleCheckpoint multiplies 
> dfs.namenode.checkpoint.period by 1000 as if it were in milliseconds.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-4117
>                 URL: https://issues.apache.org/jira/browse/HDFS-4117
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Stephen Fritz
>            Assignee: Stephen Fritz
>            Priority: Minor
>              Labels: noob
>         Attachments: HDFS-4117.patch
>
>
> This is a mistake.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to