hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bikas Saha (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-638) Restore RMDelegationTokens after RM Restart
Date Mon, 13 May 2013 18:21:17 GMT

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

Bikas Saha commented on YARN-638:
---------------------------------


I think the second operation will cover the first one since it will build the tree upto the
root. So we can avoid extra RPC to namenode.
{code}
     fs.mkdirs(fsRootDirPath);
+    fs.mkdirs(fsRMDTSecretManagerRoot);
{code}

Lets move app loading into its own function too like we did for secret manager.
{code}
+      // recover RMDTSecretManager
+      loadRMDTSecretManagerState(state);
{code}

If its not already 1 network write, can we make this 1 write operation?
{code}
+    LOG.info("Storing RMDelegationToken_" + identifier.getSequenceNumber());
+    identifier.write(fsOut);
+    fsOut.writeLong(renewDate);
{code}
{code}
+    LOG.info("Storing RMDelegationKey_" + masterKey.getKeyId());
+    masterKey.write(fsOut);
+    fsOut.flush();
{code}

Would be good to follow existing convention and have RMStateStore implement storeRMDelegationToken()
and abstract funtion be storeRMDelegationTokenState()
{code}
+  public abstract void storeRMDelegationToken(
+      RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate)
+      throws Exception;
+
{code}

Do we need to override renewToken() and cancelToken()? All we need to do it have Abstract*Manager
to call subclass.removeToken() at the end of cancelToken(). similarly have renewToken() call
subclass.updateStoredToken(identifier, renewDate). We can rename removeExpiredToken() to removeToken()
and use the same method in both cancelToken() and removeExpiredToken. Perhaps the same thing
might work with Abstract*Manager.createPassword() calling subclass.storeNewToken(identifier,
renewDate).
Much less code duplication and overriding IMO.

getAllMasterKeys() and getAllTokens() are for tests right? Then they should not be public.
If they need to be public please put @Private and @VisibleForTesting annotations.

addPersistedRMDelegationToken() : Is there any reason why this code has been duplicated from
HDFS.DelegationTokenSecretManager() instead of moving it up to Abstract*Manager? Similarly,
addPersistedMasterKey() to Abstract*Manager and using it HDFS/RM.
                
> Restore RMDelegationTokens after RM Restart
> -------------------------------------------
>
>                 Key: YARN-638
>                 URL: https://issues.apache.org/jira/browse/YARN-638
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager
>            Reporter: Jian He
>            Assignee: Jian He
>         Attachments: YARN-638.1.patch, YARN-638.2.patch, YARN-638.3.patch, YARN-638.4.patch,
YARN-638.5.patch, YARN-638.6.patch
>
>
> This is missed in YARN-581. After RM restart, RMDelegationTokens need to be added both
in DelegationTokenRenewer (addressed in YARN-581), and delegationTokenSecretManager

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message