Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-2060 DFS client RPCs using protobufs
  3. HDFS-2687

Tests are failing with ClassCastException, due to new protocol changes

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-alpha
    • test
    • None
    • Reviewed

    Description

      https://builds.apache.org/job/Hadoop-Hdfs-trunk/lastCompletedBuild/testReport/

      java.lang.ClassCastException: org.apache.hadoop.hdfs.protocol.HdfsFileStatus cannot be cast to org.apache.hadoop.hdfs.protocol.HdfsLocatedFileStatus
      at org.apache.hadoop.hdfs.DistributedFileSystem$1.hasNext(DistributedFileSystem.java:452)
      at org.apache.hadoop.fs.FileSystem$5.hasNext(FileSystem.java:1551)
      at org.apache.hadoop.fs.FileSystem$5.next(FileSystem.java:1581)
      at org.apache.hadoop.fs.FileSystem$5.next(FileSystem.java:1541)
      at org.apache.hadoop.fs.TestListFiles.testDirectory(TestListFiles.java:146)

      Attachments

        1. HDFS-2687.txt
          3 kB
          Suresh Srinivas

        Activity

          I just debugged the failure
          Following is the initial analysis:
          Previous behaviour of getListing in ClientNamenodeProtocolTranslatorR23 is
          It will pass needLocation flag as true and server side will be packed empty LocatedBlocks with HdfsLocatedFileStatus object if getBlocations are null and needLocation flag is true. So, cleint will reconstruct the HdfsLocatedFileStatus directly if HdfsfileStatus is instanceOf HdfsLocatedFileStatus.

          But with new implementation of protocolBuffers, It is just ignoring the LocatedBlocks are server side if the getBlocklocations are null. At client side, to reconstruct the HDFSFileStatus object, it is depending on locations field. Since there is no locations field here, it is considering HDFSFileStatus as just HDFSFileStatus.

          Here test assumes that HDFSFileStatus obj will be type of HdfsLocatedFileStatus and trying cast. This is failing here.

          umamaheswararao Uma Maheswara Rao G added a comment - I just debugged the failure Following is the initial analysis: Previous behaviour of getListing in ClientNamenodeProtocolTranslatorR23 is It will pass needLocation flag as true and server side will be packed empty LocatedBlocks with HdfsLocatedFileStatus object if getBlocations are null and needLocation flag is true. So, cleint will reconstruct the HdfsLocatedFileStatus directly if HdfsfileStatus is instanceOf HdfsLocatedFileStatus. But with new implementation of protocolBuffers, It is just ignoring the LocatedBlocks are server side if the getBlocklocations are null. At client side, to reconstruct the HDFSFileStatus object, it is depending on locations field. Since there is no locations field here, it is considering HDFSFileStatus as just HDFSFileStatus. Here test assumes that HDFSFileStatus obj will be type of HdfsLocatedFileStatus and trying cast. This is failing here.

          Attached patch fixes some conversion functions. This fixes three tests TestListCorruptFileBlocks, TestListFilesInDFS and TestListFilesInFileContext

          sureshms Suresh Srinivas added a comment - Attached patch fixes some conversion functions. This fixes three tests TestListCorruptFileBlocks, TestListFilesInDFS and TestListFilesInFileContext
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12507563/HDFS-2687.txt
          against trunk revision .

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

          -1 tests included. 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 javadoc. The javadoc tool appears to have generated 90 warning messages.

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

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          -1 findbugs. The patch appears to cause Findbugs (version 1.3.9) to fail.

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

          -1 core tests. The patch failed these unit tests:
          org.apache.hadoop.hdfs.server.blockmanagement.TestBlockTokenWithDFS
          org.apache.hadoop.hdfs.server.datanode.TestDataNodeMultipleRegistrations
          org.apache.hadoop.hdfs.server.blockmanagement.TestBlocksWithNotEnoughRacks
          org.apache.hadoop.hdfs.TestLeaseRecovery2

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

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/1717//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/1717//console

          This message is automatically generated.

          hadoopqa Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12507563/HDFS-2687.txt against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. 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 javadoc. The javadoc tool appears to have generated 90 warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 eclipse:eclipse. The patch built with eclipse:eclipse. -1 findbugs. The patch appears to cause Findbugs (version 1.3.9) to fail. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these unit tests: org.apache.hadoop.hdfs.server.blockmanagement.TestBlockTokenWithDFS org.apache.hadoop.hdfs.server.datanode.TestDataNodeMultipleRegistrations org.apache.hadoop.hdfs.server.blockmanagement.TestBlocksWithNotEnoughRacks org.apache.hadoop.hdfs.TestLeaseRecovery2 +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/1717//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/1717//console This message is automatically generated.

          TestLeaseReocver2, TestBlockTokenWithDFS, TestBlocksWithNotEnoughRacks are passing for me. TestDatanodeMultipleRegistrations seems like a real problem, but unrelated to this patch.

          sureshms Suresh Srinivas added a comment - TestLeaseReocver2, TestBlockTokenWithDFS, TestBlocksWithNotEnoughRacks are passing for me. TestDatanodeMultipleRegistrations seems like a real problem, but unrelated to this patch.

          I am committing this patch without +1 because these are minor changes. If there are any comments in the future, I will fix it in another jira.

          sureshms Suresh Srinivas added a comment - I am committing this patch without +1 because these are minor changes. If there are any comments in the future, I will fix it in another jira.

          +1. lgtm

          jnp Jitendra Nath Pandey added a comment - +1. lgtm

          I committed the patch.

          sureshms Suresh Srinivas added a comment - I committed the patch.
          hudson Hudson added a comment -

          Integrated in Hadoop-Common-trunk-Commit #1447 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1447/)
          HDFS-2687. Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas.

          suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #1447 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/1447/ ) HDFS-2687 . Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas. suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #1520 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1520/)
          HDFS-2687. Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas.

          suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #1520 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/1520/ ) HDFS-2687 . Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas. suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk-Commit #1470 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1470/)
          HDFS-2687. Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas.

          suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #1470 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/1470/ ) HDFS-2687 . Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas. suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk #897 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/897/)
          HDFS-2687. Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas.

          suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #897 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/897/ ) HDFS-2687 . Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas. suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk #930 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/930/)
          HDFS-2687. Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas.

          suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          hudson Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #930 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/930/ ) HDFS-2687 . Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas. suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1215366 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
          szetszwo Tsz-wo Sze added a comment -

          I have merged this to 0.23.

          szetszwo Tsz-wo Sze added a comment - I have merged this to 0.23.

          People

            sureshms Suresh Srinivas
            umamaheswararao Uma Maheswara Rao G
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: