Github user steveloughran commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9168#discussion_r42604617
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkHadoopUtil.scala 
---
    @@ -130,6 +130,21 @@ class SparkHadoopUtil extends Logging {
         UserGroupInformation.loginUserFromKeytab(principalName, keytabFilename)
       }
     
    +  def addCredentialsToCurrentUser(credentials: Credentials, hadoopConf: 
Configuration): Unit ={
    +    UserGroupInformation.getCurrentUser.addCredentials(credentials)
    +
    +    // HACK:
    +    // In HA mode, the function FileSystem.addDelegationTokens only 
returns a token for HA
    +    // NameNode. HDFS Client will generate private tokens for each 
NameNode according to the
    +    // token for HA NameNode and uses these private tokens to communicate 
with each NameNode.
    +    // If spark only update token for HA NameNode, HDFS Client will use 
the old private tokens,
    +    // which will cause token expired Error.
    +    // So:
    +    // We create a new HDFS Client, so that the new HDFS Client will 
generate and update the
    +    // private tokens for each NameNode.
    +    FileSystem.newInstance(hadoopConf).close()
    --- End diff --
    
    It's good that there is a public way to do this, but someone needs to 
verify that `FileSystem#newInstance()` was backported to the version of Hadoop 
1 which Spark support's, it went into Hadoop 0.21 with 
[HADOOP-4655](https://issues.apache.org/jira/browse/HADOOP-4655). A hadoop-1 
build would show this.
    
    Abandoning Hadoop 1 support would simplify this...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to