hadoop-hdfs-issues mailing list archives

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

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

Hadoop QA commented on HDFS-3486:
---------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12530478/HDFS-3486.002.patch
  against trunk revision .

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

    +1 tests included.  The patch appears to include 1 new or modified test files.

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

    +1 javadoc.  The javadoc tool did not generate any warning messages.

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

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

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

    +1 core tests.  The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

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

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

This message is automatically generated.
                
> 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
>         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