Skip to content

[SPARK-34914][CORE] Local mode supports Hadoop Delegation Token#55424

Open
pan3793 wants to merge 4 commits intoapache:masterfrom
pan3793:SPARK-34914
Open

[SPARK-34914][CORE] Local mode supports Hadoop Delegation Token#55424
pan3793 wants to merge 4 commits intoapache:masterfrom
pan3793:SPARK-34914

Conversation

@pan3793
Copy link
Copy Markdown
Member

@pan3793 pan3793 commented Apr 20, 2026

This PR is based on @ulysses-you's original work - #32009

What changes were proposed in this pull request?

Set up HadoopDelegationTokenManager in LocalSchedulerBackend when UserGroupInformation.isSecurityEnabled to make local mode support Hadoop Delegation Token.

Why are the changes needed?

Local mode is useful for some production use cases, this PR enables it to work on kerberized environments.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Tested in a Kerberized Hadoop cluster, with several combinations.

  • Hadoop HDFS/YARN 3.4.3, Hive Metastore 2.3.10
  • Grafana Loki is used to collect logs
  • hdfs-site.xml - dfs.namenode.delegation.key.update-interval=300000 (5 min)
  • hdfs-site.xml - dfs.namenode.delegation.token.max-lifetime=600000 (10 min)

Case: local mode with TGT cache and --proxy-user

kinit ...
spark-shell --master=local --proxy-user=foo ...

Success fetch HDFS/HMS Delegation Token, and able to CREATE and SELECT Hive tables

image

Case: local mode with keytab

spark-shell --master=local --principal foo --keytab /path/bar ...

Success fetch HDFS/HMS Delegation Token, and is able to CREATE and SELECT Hive tables, also able to renew HDFS Delegation Token

Xnip2026-04-20_16-45-46

Was this patch authored or co-authored using generative AI tooling?

Code is crafted by hand, and Claude Opus 4.7 is used for review before submitting.

@pan3793
Copy link
Copy Markdown
Member Author

pan3793 commented Apr 20, 2026

cc @ulysses-you @tgravescs @gaborgsomogyi, could you please take a look?

@pan3793
Copy link
Copy Markdown
Member Author

pan3793 commented Apr 20, 2026

also cc @cxzl25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants