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

Abhiraj Butala commented on HDFS-5591:
--------------------------------------

Hey Charles, your patch looks good, just that similar change should also be 
made in SecondaryNameNode.java. Thanks!

================================ 
--- 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
 (revision 1580757)
+++ 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
 (working copy)
@@ -376,7 +376,7 @@
         if(UserGroupInformation.isSecurityEnabled())
           UserGroupInformation.getCurrentUser().checkTGTAndReloginFromKeytab();

-        long now = Time.now();
+        long now = Time.monotonicNow();

         if (shouldCheckpointBasedOnCount() ||
             now >= lastCheckpointTime + 1000 * checkpointConf.getPeriod()) {
================================= 

> Checkpointing should use monotonic time when calculating period
> ---------------------------------------------------------------
>
>                 Key: HDFS-5591
>                 URL: https://issues.apache.org/jira/browse/HDFS-5591
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.2.0
>            Reporter: Andrew Wang
>            Priority: Minor
>              Labels: newbie
>         Attachments: HDFS-5591.001.patch
>
>
> Both StandbyCheckpointer and SecondaryNameNode use {{Time.now}} rather than 
> {{Time.monotonicNow}} to calculate how long it's been since the last 
> checkpoint. This can lead to issues when the system time is changed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to