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

Fix TestOfflineEditsViewer#testGenerated

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha1
    • Component/s: test
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      The test has been failing consistently on trunk recently. This ticket is open to fix this test to avoid false alarm on Jenkins. Figure out which recent commit caused this failure can be a good start.

      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running org.apache.hadoop.hdfs.tools.offlineEditsViewer.TestOfflineEditsViewer
      Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 15.646 sec <<< FAILURE! - in org.apache.hadoop.hdfs.tools.offlineEditsViewer.TestOfflineEditsViewer
      testGenerated(org.apache.hadoop.hdfs.tools.offlineEditsViewer.TestOfflineEditsViewer)  Time elapsed: 3.623 sec  <<< FAILURE!
      java.lang.AssertionError: Generated edits and reparsed (bin to XML to bin) should be same
      	at org.junit.Assert.fail(Assert.java:88)
      	at org.junit.Assert.assertTrue(Assert.java:41)
      	at org.apache.hadoop.hdfs.tools.offlineEditsViewer.TestOfflineEditsViewer.testGenerated(TestOfflineEditsViewer.java:125)
      
      
      Results :
      
      Failed tests: 
        TestOfflineEditsViewer.testGenerated:125 Generated edits and reparsed (bin to XML to bin) should be same
      
      Tests run: 5, Failures: 1, Errors: 0, Skipped: 0
      
      
      1. HDFS-10572-001.patch
        2 kB
        Surendra Singh Lilhore

        Issue Links

          Activity

          Hide
          linyiqun Yiqun Lin added a comment - - edited

          It seemed that the content was different in file edits and editsReparsed. I parsed the binary file editsReparsed back to xml again. And I found there were some differences. Here are the differences, from txid 84 to 86.
          Content in edits:

            <RECORD>
              <OPCODE>OP_REASSIGN_LEASE</OPCODE>
              <DATA>
                <TXID>84</TXID>
                <LEASEHOLDER>DFSClient_NONMAPREDUCE_428966708_1</LEASEHOLDER>
                <PATH>/hard-lease-recovery-test</PATH>
                <NEWHOLDER>HDFS_NameNode</NEWHOLDER>
              </DATA>
            </RECORD>
            <RECORD>
              <OPCODE>OP_CLOSE</OPCODE>
              <DATA>
                <TXID>85</TXID>
                <LENGTH>0</LENGTH>
                <INODEID>0</INODEID>
                <PATH>/hard-lease-recovery-test</PATH>
                <REPLICATION>1</REPLICATION>
                <MTIME>1467028963024</MTIME>
                <ATIME>1467028960848</ATIME>
                <BLOCKSIZE>512</BLOCKSIZE>
                <CLIENT_NAME></CLIENT_NAME>
                <CLIENT_MACHINE></CLIENT_MACHINE>
                <OVERWRITE>false</OVERWRITE>
                <BLOCK>
                  <BLOCK_ID>1073741837</BLOCK_ID>
                  <NUM_BYTES>11</NUM_BYTES>
                  <GENSTAMP>1014</GENSTAMP>
                </BLOCK>
                <PERMISSION_STATUS>
                  <USERNAME>zhexuan</USERNAME>
                  <GROUPNAME>supergroup</GROUPNAME>
                  <MODE>420</MODE>
                </PERMISSION_STATUS>
              </DATA>
            </RECORD>
          
            <RECORD>
              <OPCODE>OP_ADD_CACHE_POOL</OPCODE>
              <DATA>
                <TXID>86</TXID>
                <POOLNAME>pool1</POOLNAME>
                <OWNERNAME>zhexuan</OWNERNAME>
                <GROUPNAME>staff</GROUPNAME>
                <MODE>493</MODE>
                <LIMIT>9223372036854775807</LIMIT>
                <MAXRELATIVEEXPIRY>2305843009213693951</MAXRELATIVEEXPIRY>
                <RPC_CLIENTID>03f2daa2-e04f-4b8f-aa09-5d21e14024bd</RPC_CLIENTID>
                <RPC_CALLID>81</RPC_CALLID>
              </DATA>
            </RECORD>
          

          Content parsed from file editsReparsed:

          <RECORD>
              <OPCODE>OP_REASSIGN_LEASE</OPCODE>
              <DATA>
                <TXID>84</TXID>
                <LEASEHOLDER>DFSClient_NONMAPREDUCE_929984910_1</LEASEHOLDER>
                <PATH>/hard-lease-recovery-test</PATH>
                <NEWHOLDER>HDFS_NameNode</NEWHOLDER>
              </DATA>
            </RECORD>
            <RECORD>
              <OPCODE>OP_SET_GENSTAMP_V2</OPCODE>
              <DATA>
                <TXID>85</TXID>
                <GENSTAMPV2>1015</GENSTAMPV2>
              </DATA>
            </RECORD>
            <RECORD>
              <OPCODE>OP_REASSIGN_LEASE</OPCODE>
              <DATA>
                <TXID>86</TXID>
                <LEASEHOLDER>HDFS_NameNode</LEASEHOLDER>
                <PATH>/hard-lease-recovery-test</PATH>
                <NEWHOLDER>HDFS_NameNode</NEWHOLDER>
              </DATA>
            </RECORD>
          

          We can make use of these infos, it will help us to fix this issue.

          Show
          linyiqun Yiqun Lin added a comment - - edited It seemed that the content was different in file edits and editsReparsed . I parsed the binary file editsReparsed back to xml again. And I found there were some differences. Here are the differences, from txid 84 to 86. Content in edits : <RECORD> <OPCODE>OP_REASSIGN_LEASE</OPCODE> <DATA> <TXID>84</TXID> <LEASEHOLDER>DFSClient_NONMAPREDUCE_428966708_1</LEASEHOLDER> <PATH>/hard-lease-recovery-test</PATH> <NEWHOLDER>HDFS_NameNode</NEWHOLDER> </DATA> </RECORD> <RECORD> <OPCODE>OP_CLOSE</OPCODE> <DATA> <TXID>85</TXID> <LENGTH>0</LENGTH> <INODEID>0</INODEID> <PATH>/hard-lease-recovery-test</PATH> <REPLICATION>1</REPLICATION> <MTIME>1467028963024</MTIME> <ATIME>1467028960848</ATIME> <BLOCKSIZE>512</BLOCKSIZE> <CLIENT_NAME></CLIENT_NAME> <CLIENT_MACHINE></CLIENT_MACHINE> <OVERWRITE> false </OVERWRITE> <BLOCK> <BLOCK_ID>1073741837</BLOCK_ID> <NUM_BYTES>11</NUM_BYTES> <GENSTAMP>1014</GENSTAMP> </BLOCK> <PERMISSION_STATUS> <USERNAME>zhexuan</USERNAME> <GROUPNAME>supergroup</GROUPNAME> <MODE>420</MODE> </PERMISSION_STATUS> </DATA> </RECORD> <RECORD> <OPCODE>OP_ADD_CACHE_POOL</OPCODE> <DATA> <TXID>86</TXID> <POOLNAME>pool1</POOLNAME> <OWNERNAME>zhexuan</OWNERNAME> <GROUPNAME>staff</GROUPNAME> <MODE>493</MODE> <LIMIT>9223372036854775807</LIMIT> <MAXRELATIVEEXPIRY>2305843009213693951</MAXRELATIVEEXPIRY> <RPC_CLIENTID>03f2daa2-e04f-4b8f-aa09-5d21e14024bd</RPC_CLIENTID> <RPC_CALLID>81</RPC_CALLID> </DATA> </RECORD> Content parsed from file editsReparsed : <RECORD> <OPCODE>OP_REASSIGN_LEASE</OPCODE> <DATA> <TXID>84</TXID> <LEASEHOLDER>DFSClient_NONMAPREDUCE_929984910_1</LEASEHOLDER> <PATH>/hard-lease-recovery-test</PATH> <NEWHOLDER>HDFS_NameNode</NEWHOLDER> </DATA> </RECORD> <RECORD> <OPCODE>OP_SET_GENSTAMP_V2</OPCODE> <DATA> <TXID>85</TXID> <GENSTAMPV2>1015</GENSTAMPV2> </DATA> </RECORD> <RECORD> <OPCODE>OP_REASSIGN_LEASE</OPCODE> <DATA> <TXID>86</TXID> <LEASEHOLDER>HDFS_NameNode</LEASEHOLDER> <PATH>/hard-lease-recovery-test</PATH> <NEWHOLDER>HDFS_NameNode</NEWHOLDER> </DATA> </RECORD> We can make use of these infos, it will help us to fix this issue.
          Hide
          ajisakaa Akira Ajisaka added a comment -

          Raise the priority to blocker because the test failure means OfflineEditsViewer is really broken.

          Show
          ajisakaa Akira Ajisaka added a comment - Raise the priority to blocker because the test failure means OfflineEditsViewer is really broken.
          Hide
          ajisakaa Akira Ajisaka added a comment -

          The test also fails in branch-2.

          Show
          ajisakaa Akira Ajisaka added a comment - The test also fails in branch-2.
          Hide
          surendrasingh Surendra Singh Lilhore added a comment -

          Its broken by HDFS-10328. HDFS-10328 added one new field defaultReplication in CachePoolInfo.java, but for the same OEV and OIV related changes are pending.

          Show
          surendrasingh Surendra Singh Lilhore added a comment - Its broken by HDFS-10328 . HDFS-10328 added one new field defaultReplication in CachePoolInfo.java , but for the same OEV and OIV related changes are pending.
          Hide
          surendrasingh Surendra Singh Lilhore added a comment -

          Attached initial patch.
          Please review.

          Show
          surendrasingh Surendra Singh Lilhore added a comment - Attached initial patch. Please review.
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 33s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
          +1 mvninstall 6m 56s trunk passed
          +1 compile 0m 50s trunk passed
          +1 checkstyle 0m 25s trunk passed
          +1 mvnsite 0m 55s trunk passed
          +1 mvneclipse 0m 12s trunk passed
          +1 findbugs 1m 42s trunk passed
          +1 javadoc 0m 56s trunk passed
          +1 mvninstall 0m 47s the patch passed
          +1 compile 0m 43s the patch passed
          +1 javac 0m 43s the patch passed
          +1 checkstyle 0m 23s the patch passed
          +1 mvnsite 0m 50s the patch passed
          +1 mvneclipse 0m 9s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 47s the patch passed
          +1 javadoc 0m 53s the patch passed
          -1 unit 69m 23s hadoop-hdfs in the patch failed.
          +1 asflicense 0m 18s The patch does not generate ASF License warnings.
          88m 55s



          Reason Tests
          Failed junit tests hadoop.hdfs.qjournal.client.TestQuorumJournalManager
            hadoop.hdfs.server.namenode.snapshot.TestOpenFilesWithSnapshot



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:85209cc
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12815909/HDFS-10572-001.patch
          JIRA Issue HDFS-10572
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 72b2cac6e3c6 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 8b281bc
          Default Java 1.8.0_91
          findbugs v3.0.0
          unit https://builds.apache.org/job/PreCommit-HDFS-Build/15967/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
          Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/15967/testReport/
          modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/15967/console
          Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 33s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 6m 56s trunk passed +1 compile 0m 50s trunk passed +1 checkstyle 0m 25s trunk passed +1 mvnsite 0m 55s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 42s trunk passed +1 javadoc 0m 56s trunk passed +1 mvninstall 0m 47s the patch passed +1 compile 0m 43s the patch passed +1 javac 0m 43s the patch passed +1 checkstyle 0m 23s the patch passed +1 mvnsite 0m 50s the patch passed +1 mvneclipse 0m 9s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 47s the patch passed +1 javadoc 0m 53s the patch passed -1 unit 69m 23s hadoop-hdfs in the patch failed. +1 asflicense 0m 18s The patch does not generate ASF License warnings. 88m 55s Reason Tests Failed junit tests hadoop.hdfs.qjournal.client.TestQuorumJournalManager   hadoop.hdfs.server.namenode.snapshot.TestOpenFilesWithSnapshot Subsystem Report/Notes Docker Image:yetus/hadoop:85209cc JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12815909/HDFS-10572-001.patch JIRA Issue HDFS-10572 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 72b2cac6e3c6 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 8b281bc Default Java 1.8.0_91 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HDFS-Build/15967/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/15967/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/15967/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          ajisakaa Akira Ajisaka added a comment -

          +1, the test failures are not related to the patch. I ran the failed tests locally and all of them passed.

          Show
          ajisakaa Akira Ajisaka added a comment - +1, the test failures are not related to the patch. I ran the failed tests locally and all of them passed.
          Hide
          ajisakaa Akira Ajisaka added a comment -

          Committed this to trunk and branch-2. Thanks Xiaoyu Yao for reporting this and Surendra Singh Lilhore for fixing the blocker!

          Show
          ajisakaa Akira Ajisaka added a comment - Committed this to trunk and branch-2. Thanks Xiaoyu Yao for reporting this and Surendra Singh Lilhore for fixing the blocker!
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-trunk-Commit #10048 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10048/)
          HDFS-10572. Fix TestOfflineEditsViewer#testGenerated. Contributed by (aajisaka: rev 2e835d986ecdc881eab3ab9650d854b6df482b20)

          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageSerialization.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #10048 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10048/ ) HDFS-10572 . Fix TestOfflineEditsViewer#testGenerated. Contributed by (aajisaka: rev 2e835d986ecdc881eab3ab9650d854b6df482b20) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageSerialization.java

            People

            • Assignee:
              surendrasingh Surendra Singh Lilhore
              Reporter:
              xyao Xiaoyu Yao
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development