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

when outputting XML, OfflineEditsViewer can't handle some edits containing non-ASCII strings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.3-alpha
    • 2.1.0-beta
    • None
    • None
    • Reviewed

    Description

      It seems that when outputting XML, OfflineEditsViewer can't handle some edits containing non-ASCII strings.

      Example:

      cmccabe@keter:/h> ./bin/hdfs oev -i ~/Downloads/current2/edits -o /tmp/u.xml                                         
      17:11:24,662 ERROR OfflineEditsBinaryLoader:82 - Got IOException at position 10593
      Encountered exception. Exiting: SAX error: The character '�' is an invalid XML character
      java.io.IOException: SAX error: The character '�' is an invalid XML character
              at org.apache.hadoop.hdfs.tools.offlineEditsViewer.XmlEditsVisitor.visitOp(XmlEditsVisitor.java:119)
              at org.apache.hadoop.hdfs.tools.offlineEditsViewer.OfflineEditsBinaryLoader.loadEdits(OfflineEditsBinaryLoader.java:78)
              at org.apache.hadoop.hdfs.tools.offlineEditsViewer.OfflineEditsViewer.go(OfflineEditsViewer.java:142)
              at org.apache.hadoop.hdfs.tools.offlineEditsViewer.OfflineEditsViewer.run(OfflineEditsViewer.java:228)
              at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
              at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
              at org.apache.hadoop.hdfs.tools.offlineEditsViewer.OfflineEditsViewer.main(OfflineEditsViewer.java:237)
      

      Probably, we forgot to properly escape and/or re-encode a filename before putting it into the XML. The other processors (stats, binary) don't have this problem, so it is purely an XML encoding issue.

      Attachments

        1. HDFS-4235.003.patch
          11 kB
          Colin McCabe
        2. HDFS-4235.002.patch
          11 kB
          Colin McCabe
        3. HDFS-4235.001.patch
          9 kB
          Colin McCabe

        Activity

          People

            cmccabe Colin McCabe
            cmccabe Colin McCabe
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: