facebook/hadoop-20 — Issue #6: SecondaryNamenode failed when doCheckpoint
Author: ZJB
Created: 2012-01-11 07:15:49+00:00
State: open

hi, all

I use the lastest release version of hadoop-20 ( fb-branch). When secondary NameNode doing doCheckpoint, I encounter the following problem:

2012-01-11 14:02:01,464 ERROR org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: java.lang.NullPointerException
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.incrDeletedFileCount(FSDirectory.java:170)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.unprotectedDelete(FSDirectory.java:859)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.unprotectedDelete(FSDirectory.java:814)
at org.apache.hadoop.hdfs.server.namenode.FSEditLog.loadFSEdits(FSEditLog.java:708)
at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSEdits(FSImage.java:1445)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode$CheckpointStorage.doMerge(SecondaryNameNode.java:595)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode$CheckpointStorage.access$000(SecondaryNameNode.java:488)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.doMerge(SecondaryNameNode.java:365)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.doCheckpoint(SecondaryNameNode.java:328)
at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.run(SecondaryNameNode.java:225)
at java.lang.Thread.run(Thread.java:722)

When SecondaryNameNode doCheckpoint, It will use the NameNode.getNameNodeMetrics() method to get "myMetrics" static field which only initialized by NameNode constructor method. But It seems that SeconadryNameNode will not make NameNode object, so the myMetrics static field is null.

Please give me some advice to resolve the problem. Thanks!