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

Jakob Homan commented on HDFS-1572:
-----------------------------------

Liyin-
   I'd rather not duplicate a bunch of the logic in the test.  Were we to put 
out the effort into testing, I'd rather go ahead and take an approach like what 
Project Voldemort has for time-dependent operations: http://s.apache.org/uU.  I 
recently used it to good effect in unit testing a similar bit of code: 
http://s.apache.org/bMQ  It worked quite well.

That being said, I think the patch I submitted does a more complete job of 
cleaning up the code in general and I'd like to go ahead with that one.  Adding 
more tests would be great, but is a bigger issue.  The failed unit tests seem 
to be bogus time outs.  They're not related to this code and are not 
reproducing on my local box.  I'm running the full test suite now and will post 
results when they finish.

> Checkpointer should trigger checkpoint with specified period.
> -------------------------------------------------------------
>
>                 Key: HDFS-1572
>                 URL: https://issues.apache.org/jira/browse/HDFS-1572
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 0.22.0
>            Reporter: Liyin Liang
>            Priority: Blocker
>             Fix For: 0.21.0
>
>         Attachments: 1527-1.diff, 1572-2.diff, HDFS-1572.patch
>
>
> {code:}
>   long now = now();
>   boolean shouldCheckpoint = false;
>   if(now >= lastCheckpointTime + periodMSec) {
>     shouldCheckpoint = true;
>   } else {
>     long size = getJournalSize();
>     if(size >= checkpointSize)
>       shouldCheckpoint = true;
>   }
> {code}
> {dfs.namenode.checkpoint.period} in configuration determines the period of 
> checkpoint. However, with above code, the Checkpointer triggers a checkpoint 
> every 5 minutes (periodMSec=5*60*1000). According to SecondaryNameNode.java, 
> the first *if*  statement should be:
>  {code:}
> if(now >= lastCheckpointTime + 1000 * checkpointPeriod) {
>  {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to