Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-4771

FSImage saveFSImage() will have problem.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.18.2, 0.19.0
    • 0.20.0
    • None
    • None
    • Reviewed

    Description

      When you format the namenode , hadoop will call FSImage.saveFsImage(). saveFsImage includes the following code:

      out.writeLong(fsDir.rootDir.numItemsInTree());

      When format, the fsDir.rootDir.numItemsInTree() should be 1 (it include the rootdir). But now fsDir.rootDir.numItemsInTree() is 0.

      The reason why the bug is not simply discovered or triggered is the code in FSImage.saveFsImage().->saveINode2Image().

      } else { // write directory inode
      out.writeShort(0); // replication

      Because the directory doesn't have replication factor, so here is 0. This will cause loadFilesUnderConstruction() will not load any files when hadoop fisrt starts up after format.

      Attachments

        1. hadoop-4771.patch
          0.5 kB
          Ruyue Ma
        2. hadoop-4771-v2.patch
          0.7 kB
          Ruyue Ma

        Issue Links

          Activity

            People

              mry.maillist Ruyue Ma
              mry.maillist Ruyue Ma
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: