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

Timo Walter commented on HDFS-14158:
------------------------------------

Hi [~ajisakaa],

you said: "If periodMSec becomes longer than 5 minutes, the checkpointer sleeps 
longer than 5 minutes after checkpointing and we cannot check the transaction 
count of the edit log when sleeping"

But if you look in the source code, where the value of *periodMsec* gets 
assigned, you find only this code section (File: Checkpointer.java):
{code:java}
//Main work loop of the Checkpointer
public void run() {
  // Check the size of the edit log once every 5 minutes.
  long periodMSec = 5 * 60;   // 5 minutes
  if(checkpointConf.getPeriod() < periodMSec) {
    periodMSec = checkpointConf.getPeriod();
  }
{code}
First, *periodMsec* gets his default value of 5 minutes (5*60). After that 
(next line) the if-statement checks, wether the configured period is lower than 
the default one (5 minutes). If it's lower, *periodMsec* gets the lower value. 
BUT when it's > than 5 minutes, nothing happens.

--> *periodMsec* is always 5 minuts or lower.

 

i reproduced this issue on my own HDFS cluster. The checkpointer node 
checkpoints every 5 minutes and ignores everything > 5 minutes.

 

If I'm wrong with my suggestion, correct me please ;)

 

Thank you! ;)

 

> Checkpointer ignores configured time period > 5 minutes
> -------------------------------------------------------
>
>                 Key: HDFS-14158
>                 URL: https://issues.apache.org/jira/browse/HDFS-14158
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.8.1
>            Reporter: Timo Walter
>            Priority: Minor
>              Labels: checkpoint, hdfs, namenode
>
> The checkpointer always triggers a checkpoint every 5 minutes and ignores the 
> flag "*dfs.namenode.checkpoint.period*", if its greater than 5 minutes.
> See the code below (in Checkpointer.java):
> {code:java}
> //Main work loop of the Checkpointer
> public void run() {
>   // Check the size of the edit log once every 5 minutes.
>   long periodMSec = 5 * 60;   // 5 minutes
>   if(checkpointConf.getPeriod() < periodMSec) {
>     periodMSec = checkpointConf.getPeriod();
>   }
> {code}
> If the configured period ("*dfs.namenode.checkpoint.period*") is lower than 5 
> minutes, you choose use the configured one. But it always ignores it, if it's 
> greater than 5 minutes.
>  
> In my opinion, the if-expression should be:
> {code:java}
> if(checkpointConf.getPeriod() > periodMSec) {
>     periodMSec = checkpointConf.getPeriod();
>   }
> {code}
>  
> Then "*dfs.namenode.checkpoint.period*" won't get ignored.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to