hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-3486) offlineimageviewer can't read fsimage files that contain persistent delegation tokens
Date Wed, 11 Jul 2012 13:28:35 GMT

    [ https://issues.apache.org/jira/browse/HDFS-3486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411476#comment-13411476
] 

Hudson commented on HDFS-3486:
------------------------------

Integrated in Hadoop-Hdfs-0.23-Build #310 (See [https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/310/])
    svn merge -c 1344970, 1308485 FIXES: HDFS-3486 and HADOOP-8242 (Revision 1359821)

     Result = UNSTABLE
daryn : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1359821
Files : 
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenIdentifier.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/IndentedImageVisitor.java
* /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java

                
> offlineimageviewer can't read fsimage files that contain persistent delegation tokens
> -------------------------------------------------------------------------------------
>
>                 Key: HDFS-3486
>                 URL: https://issues.apache.org/jira/browse/HDFS-3486
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security, tools
>    Affects Versions: 2.0.0-alpha
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>             Fix For: 0.23.3, 2.0.1-alpha
>
>         Attachments: HDFS-3486.001.patch, HDFS-3486.002.patch
>
>
> OfflineImageViewer (oiv) crashes when trying to read fsimage files that contain persistent
delegation tokens.
> Example stack trace:
> {code}
> Caused by: java.lang.IndexOutOfBoundsException
>         at java.io.DataInputStream.readFully(DataInputStream.java:175)
>         at org.apache.hadoop.io.Text.readFields(Text.java:284)
>         at org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier.readFields(AbstractDelegationTokenIdentifier.java:178)
>         at org.apache.hadoop.hdfs.tools.offlineImageViewer.ImageLoaderCurrent.processDelegationTokens(ImageLoaderCurrent.java:222)
>         at org.apache.hadoop.hdfs.tools.offlineImageViewer.ImageLoaderCurrent.loadImage(ImageLoaderCurrent.java:186)
>         at org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.go(OfflineImageViewer.java:129)
> {code}
> The oiv and loadFSImage code paths are separate.  The issue here seems to be that the
loadFSImage code path has diverged from the oiv code path.
> On the loadFSImage code path (from FSImageFormat#loadCurrentTokens):
> {code}
>   /**
>    * Private helper methods to load Delegation tokens from fsimage
>    */
>   private synchronized void loadCurrentTokens(DataInputStream in)
>       throws IOException {
>     int numberOfTokens = in.readInt();
>     for (int i = 0; i < numberOfTokens; i++) {
>       DelegationTokenIdentifier id = new DelegationTokenIdentifier();
>       id.readFields(in);
>       long expiryTime = in.readLong();
>       addPersistedDelegationToken(id, expiryTime);
>     }
>   }
> {code}
> Notice how it loads a 4-byte int after every DelegationTokenIdentifier.
> On the oiv code path (from ImageLoaderCurrent#processDelegationTokens):
> {code}
>     int numDTokens = in.readInt();
>     v.visitEnclosingElement(ImageElement.DELEGATION_TOKENS,
>         ImageElement.NUM_DELEGATION_TOKENS, numDTokens);
>     for(int i=0; i<numDTokens; i++){
>       DelegationTokenIdentifier id = new  DelegationTokenIdentifier();
>       id.readFields(in);
>       v.visit(ImageElement.DELEGATION_TOKEN_IDENTIFIER, id.toString());
>     }
> {code}
> Notice how it does *not* load a 4-byte int after every DelegationTokenIdentifier.
> This bug seems to have been introduced by change 916534, the same change which introduced
persistent delegation tokens.  So I don't think oiv was ever able to decode them in the past.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message