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

Konstantin Shvachko commented on HDFS-1839:
-------------------------------------------

{{moveLastCheckpoint()}} first 
- removes {{previous.checkpoint}}, then 
- renames {{lastcheckpoint.tmp}} to {{previous.checkpoint}}, if 
{{lastcheckpoint.tmp}} exists.

So if you call {{moveLastCheckpoint()}} twice in one session, then the first 
call will correctly rename {{lastcheckpoint.tmp}} to {{previous.checkpoint}}, 
but the second will only remove  {{previous.checkpoint}}, because 
{{lastcheckpoint.tmp}} does not exist anymore.

The two calls are done in {{SNN.doCheckpoint()}} - one comes from 
{{saveNamespace()}}, which is called by {{doMerge()}}, and another later from 
{{endCheckpoint()}}.
The solution is to remove {{endCheckpoint()}}, which seems to be a redundant 
operation.

> SecondaryNameNode should not discard "previous.checkpoint"
> ----------------------------------------------------------
>
>                 Key: HDFS-1839
>                 URL: https://issues.apache.org/jira/browse/HDFS-1839
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.1
>            Reporter: Konstantin Shvachko
>             Fix For: 0.22.0
>
>
> While creating a checkpoint SNN calls {{moveLastCheckpoint()}} twice. As a 
> result directory "previous.checkpoint" is getting removed. 
> "previous.checkpoint" directory holds the checkpoint that was created before 
> the current one. It is useful for manual recovery, but nothing else.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to