Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-132

Namenode in Safemode reports to Simon non-zero number of deleted files during startup

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.20.3, 0.21.0, 0.22.0
    • Fix Version/s: 0.20.3
    • Component/s: namenode
    • Labels:
      None
    • Hadoop Flags:
      Incompatible change, Reviewed
    • Release Note:
      Hide
      With this incompatible change, under metrics context "dfs", the record name "FSDirectory" is no longer available. The metrics "files_deleted" from the deleted record "FSDirectory" is now available in metrics context "dfs", record name "namenode" with the metrics name "FilesDeleted".
      Show
      With this incompatible change, under metrics context "dfs", the record name "FSDirectory" is no longer available. The metrics "files_deleted" from the deleted record "FSDirectory" is now available in metrics context "dfs", record name "namenode" with the metrics name "FilesDeleted".

      Description

      Currently when a namenode starts up it may call "delete" when loading edits. But metrics file_deleted is collected and reported in FSDirectory where it does not and is not able to check if namenode is in safemode. So from the monitoring UI, we see non-zero number of files deleted.

      A possible fix is to have delete to return the number of files deleted and then the metrics is collected and reported at NameNode the same as other namenode metrics.

      1. HDFS-132-0.20.patch
        13 kB
        Konstantin Shvachko
      2. HDFS-132.y20.patch
        14 kB
        Konstantin Shvachko
      3. HDFS-132.2.patch
        16 kB
        Suresh Srinivas
      4. HDFS-132.1.patch
        16 kB
        Suresh Srinivas
      5. HDFS-132.patch
        14 kB
        Suresh Srinivas

        Issue Links

          Activity

          Hide
          Suresh Srinivas added a comment -

          FSDirectory.directoryMetrics reports two metrics - files_created and files_deleted. This is unnecessary as it is already covered by the NameNodeMetrics "FilesCreated" and "DeletedFileOps".

          I propose deleting file_created and files_deleted metrics from FSDirectory.directoryMetrics. With that directoryMetrics will be reporting nothing. We could leave it in FSDirectory for future use or delete it altogether.

          Show
          Suresh Srinivas added a comment - FSDirectory.directoryMetrics reports two metrics - files_created and files_deleted. This is unnecessary as it is already covered by the NameNodeMetrics "FilesCreated" and "DeletedFileOps". I propose deleting file_created and files_deleted metrics from FSDirectory.directoryMetrics. With that directoryMetrics will be reporting nothing. We could leave it in FSDirectory for future use or delete it altogether.
          Hide
          Suresh Srinivas added a comment -

          Changes:

          1. FSDirectory.java
            • Removed metrics with context name "dfs" and record name "FSDirectory". This was being used just to track files deleted. Moved the metrics for files deleted to NameNodeMetrics.
            • Not very happy with introducing an argument logReplay in unprotectedDelete and unprotectedRename to differentiate an operation while replaying edits log from user operation. The assumption in the code is - unprotectedXXX is called for both regular operation and operation while replaying edits. However, returning number of files deleted from these methods seems like a lot more change and the method signature will not be clean either.
          2. TestNameNodeMetrics.java - Removed importing org.mortbay.log.Log. Also cleaned up the code a bit to get rid of some warnings.

          Note removing metrics record "FSDirectory" is an incompatible change.

          Show
          Suresh Srinivas added a comment - Changes: FSDirectory.java Removed metrics with context name "dfs" and record name "FSDirectory". This was being used just to track files deleted. Moved the metrics for files deleted to NameNodeMetrics. Not very happy with introducing an argument logReplay in unprotectedDelete and unprotectedRename to differentiate an operation while replaying edits log from user operation. The assumption in the code is - unprotectedXXX is called for both regular operation and operation while replaying edits. However, returning number of files deleted from these methods seems like a lot more change and the method signature will not be clean either. TestNameNodeMetrics.java - Removed importing org.mortbay.log.Log. Also cleaned up the code a bit to get rid of some warnings. Note removing metrics record "FSDirectory" is an incompatible change.
          Hide
          Suresh Srinivas added a comment -

          New version of the patch with minor changes:

          1. unprotectedDeleted returns the number of deleted inodes and no longer takes logReplay argument.
          2. unprotectedRenameTo returns boolean to indicate the existing rename target was overwritten. logReplay argument to the method is removed.
          Show
          Suresh Srinivas added a comment - New version of the patch with minor changes: unprotectedDeleted returns the number of deleted inodes and no longer takes logReplay argument. unprotectedRenameTo returns boolean to indicate the existing rename target was overwritten. logReplay argument to the method is removed.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12440647/HDFS-132.1.patch
          against trunk revision 929406.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 3 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed core unit tests.

          -1 contrib tests. The patch failed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/145/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/145/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/145/artifact/trunk/build/test/checkstyle-errors.html
          Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/145/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12440647/HDFS-132.1.patch against trunk revision 929406. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/145/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/145/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/145/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/145/console This message is automatically generated.
          Hide
          Suresh Srinivas added a comment -

          Removed @param comment that described a param that is no longer in the code.

          Show
          Suresh Srinivas added a comment - Removed @param comment that described a param that is no longer in the code.
          Hide
          Hairong Kuang added a comment -

          +1

          Show
          Hairong Kuang added a comment - +1
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12440959/HDFS-132.2.patch
          against trunk revision 931357.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 3 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed core unit tests.

          -1 contrib tests. The patch failed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/149/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/149/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/149/artifact/trunk/build/test/checkstyle-errors.html
          Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/149/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12440959/HDFS-132.2.patch against trunk revision 931357. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/149/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/149/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/149/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/149/console This message is automatically generated.
          Hide
          Suresh Srinivas added a comment -

          Failed test TestHDFSServerPorts is unrelated to the patch and is already tracked by HDFS-887.

          Show
          Suresh Srinivas added a comment - Failed test TestHDFSServerPorts is unrelated to the patch and is already tracked by HDFS-887 .
          Hide
          Suresh Srinivas added a comment -

          Committed the patch to trunk.

          Show
          Suresh Srinivas added a comment - Committed the patch to trunk.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #235 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/235/)
          HDFS-132. Fix namenode to not report files deleted metrics for deletions done while replaying edits during startup. Contributed by Suresh Srinvias.

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #235 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/235/ ) HDFS-132 . Fix namenode to not report files deleted metrics for deletions done while replaying edits during startup. Contributed by Suresh Srinvias.
          Hide
          Konstantin Shvachko added a comment -

          This proting to 0.20 and y0.20

          Show
          Konstantin Shvachko added a comment - This proting to 0.20 and y0.20
          Hide
          Suresh Srinivas added a comment -

          +1 for the 20 and y20 version of the patch.

          Show
          Suresh Srinivas added a comment - +1 for the 20 and y20 version of the patch.
          Hide
          Konstantin Shvachko added a comment -

          Here is the right attachment for 0.20.

          Show
          Konstantin Shvachko added a comment - Here is the right attachment for 0.20.
          Hide
          Konstantin Shvachko added a comment -

          I committed this to 0.20.

          Show
          Konstantin Shvachko added a comment - I committed this to 0.20.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #340 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/340/)
          HDFS-132. Reflect port to branch 0.20 in trunk. (shv)

          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #340 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/340/ ) HDFS-132 . Reflect port to branch 0.20 in trunk. (shv)

            People

            • Assignee:
              Suresh Srinivas
              Reporter:
              Hairong Kuang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development