Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14551

NN throws NPE if downgrade it during rolling upgrade from 3.x to 2.x

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      We can downgrade NN during roling upgrade (runned "hdfs dfsadmin -rollingUpgrade prepare) with HDFS-8432 involved. But with HDFS-14172 if the image has any unrecogized section, it will throw IOException at

      FSImageFormatProtobuf.java
      private void loadInternal(......) {
          ......
          String n = s.getName();
          SectionName sectionName = SectionName.fromString(n);
          if (sectionName == null) {
            throw new IOException("Unrecognized section " + n);
          }
          ......
      }
      

      and throw NPE on Hadoop 2.x

      FSImageFormatProtobuf.java
      private void loadInternal(......) {
          ......
          String n = s.getName();
          switch (sectionName)
          ......
      }
      

      When we downgrade NN from 3.x to 2.x, NN may load the image saved by 3.x NN. Then the lack of SectionName.ERASURE_CODING can break 2.x NN.
      We should just skip the unrecogized section instead of throwing exception.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              John Smith Yuxuan Wang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: