[SPARK-21906][YARN][Spark Core]Don't runAsSparkUser to switch UserGroupInformation in YARN mode#19121
[SPARK-21906][YARN][Spark Core]Don't runAsSparkUser to switch UserGroupInformation in YARN mode#19121yaooqinn wants to merge 1 commit intoapache:masterfrom yaooqinn:SPARK-21906
Conversation
|
Can one of the admins verify this patch? |
|
Can you please elaborate the problem you met, did you meet any unexpected behavior? The changes here get rid of env variable "SPARK_USER", this might be OK for yarn application, but what if user runs on standalone mode and explicitly set this "SPARK_USER", your changes seems break the semantics. |
|
|
UGI is not only used for security, normally it is used for Spark application to communicate with Hadoop using correct user. doAs already wraps the whole |
|
@jerryshao thanks for replying if a user explicitly set |
|
No, I don't agree with you. SPARK_USER is set in SparkContext with driver's current UGI and this env variable will be propagated to executors to create executor's UGI with the same user in driver. For example, if your standalone cluster is started with user "spark", and you submit a Spark application with user "foo" in the gateway, so all the executors should use "foo" to access Hadoop, but with your changes, executors will use "spark" to communicate with Hadoop, since executor process is forked with user "spark" by worker, it is not correct. |
|
@jerryshao Yes, you are right. unlike yarn standalone don‘t switch the jvm process user. but you said that if a user explicitly set I may change this to only affect yarn mode. |
|
Sorry I didn't clearly say the problem. But IMO the changes you made is really not so necessary. |
|
em..this may also not work for |
What changes were proposed in this pull request?
1、The Yarn application‘s ugi is determined by the ugi launching it
2、 runAsSparkUser is used to switch a ugi as same as itself, because we have already set
env("SPARK_USER") = UserGroupInformation.getCurrentUser().getShortUserName()in the am container context
How was this patch tested?
manual tests
cc @vanzin