You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2023/11/10 01:32:28 UTC

[PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

dongjoon-hyun opened a new pull request, #43743:
URL: https://github.com/apache/spark/pull/43743

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   <!--
   If generative AI tooling has been used in the process of authoring this patch, please include the
   phrase: 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1806566186

   @mridulm . It seems that you mean SPARK-45754 (Support `spark.deploy.appIdPattern`) feature which I already delivered that level of support.
   > Why not continue to use the existing scheme (iirc prefix + time: I am afk, so can't confirm), but make the prefix customizable instead ?
   
   Let me give you the context, @mridulm . There is an umbrella JIRA and most customizable configurations are delivered already.
   
   - https://issues.apache.org/jira/browse/SPARK-45869 (Revisit and Improve Spark Standalone Cluster)
   
   <img width="520" alt="Screenshot 2023-11-10 at 3 40 12 PM" src="https://github.com/apache/spark/assets/9700541/65e75543-7eed-41d7-83b8-6e0c6bd8ff87">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #43743:
URL: https://github.com/apache/spark/pull/43743#discussion_r1388798816


##########
core/src/main/scala/org/apache/spark/deploy/master/Master.scala:
##########
@@ -1041,7 +1042,11 @@ private[deploy] class Master(
       ApplicationInfo = {
     val now = System.currentTimeMillis()
     val date = new Date(now)
-    val appId = newApplicationId(date)
+    val appId = if (useAppNameAsAppId) {
+      desc.name.toLowerCase().replaceAll("\\s+", "")
+    } else {
+      newApplicationId(date)
+    }

Review Comment:
   Should we add `nextAppNumber` as postfix to the appId as usual?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1811435846

   Sounds good to me, thanks @dongjoon-hyun !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1804939250

   Could you review this experimental feature, @viirya ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1804979674

   Thank you, @viirya !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1804986323

   - Let me switch JIRAs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #43743:
URL: https://github.com/apache/spark/pull/43743#discussion_r1388802379


##########
core/src/main/scala/org/apache/spark/deploy/master/Master.scala:
##########
@@ -1041,7 +1042,11 @@ private[deploy] class Master(
       ApplicationInfo = {
     val now = System.currentTimeMillis()
     val date = new Date(now)
-    val appId = newApplicationId(date)
+    val appId = if (useAppNameAsAppId) {
+      desc.name.toLowerCase().replaceAll("\\s+", "")
+    } else {
+      newApplicationId(date)
+    }

Review Comment:
   This experimental design is for the advanced users who maintains unique appName.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1806339650

   Why not continue to use the existing scheme (iirc prefix + time: I am afk, so can't confirm), but make the prefix customizable instead ?
   That keeps it human readable, while minimizing conflicts.
   
   Pushing responsibility to user and documenting it as such would still result in hard to debug failure modes :-) 
   
   I dont use standalone mode - so not sure how common this can become, but something to think about.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1806033968

   Thank you for review, @mridulm .
   
   > What is the behavior if this is turned on and there is a conflict ? Will it result in application submission failure ? Overwriting running app state with new app (or vice versa) ?
   
   Yes, it will. Nothing will work correctly. It's a user responsibility to keep it unique as a ID.
   
   > In other words, what is the benefit of doing this ?
   
   This feature gives the users lots of controllability. For simple examples,
   1. Human-recognizable App ID (which was the goal of `App Name`).
   2. Human-recognizable event log file names based on (1) in the remote storage like S3.
   3. Human-recognizable driver log file names based on (1) in the remote storage like S3.
   
   Based on (1), (2) and (3), they can build their service very easily by linking jobs and logs (event/driver) effortless with their patterns.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45869][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1804984755

   Oops. I used the umbrella JIRA id.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1808489871

   This is not answering my query @dongjoon-hyun - as to why we are allowing expicitly setting an application id, and introducing hard to debug modes; instead of relying on minimizing the issue.
   I was not specifically referring to [SPARK-45754](https://issues.apache.org/jira/browse/SPARK-45754), but that is indeed a good option as well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #43743:
URL: https://github.com/apache/spark/pull/43743#discussion_r1388794250


##########
core/src/main/scala/org/apache/spark/deploy/master/Master.scala:
##########
@@ -1041,7 +1042,11 @@ private[deploy] class Master(
       ApplicationInfo = {
     val now = System.currentTimeMillis()
     val date = new Date(now)
-    val appId = newApplicationId(date)
+    val appId = if (useAppNameAsAppId) {
+      desc.name.toLowerCase().replaceAll("\\s+", "")
+    } else {
+      newApplicationId(date)
+    }

Review Comment:
   Hmm, how Spark responses to duplicate appId? If two submitted applications have same app names.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1811322183

   Sure, I love to provide more document on this because I want to advertise `Spark Standalone Cluster` in Apache Spark 4.0.0 more. 
   
   Currently, I'm revisiting the documentation on `Spark Standalone Cluster`. The first one was https://github.com/apache/spark/pull/43774 and I'll make a few more PRs including this too.
   
   Does it meet your requirement, @mridulm ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1809845273

   To @mridulm . The above was the exact answer for your following question. What I meant is that Apache Spark already provide more patterns including `the prefix customazable`.
   > Why not continue to use the existing scheme (iirc prefix + time: I am afk, so can't confirm), but make the prefix customizable instead ?
   
   For the following question, that is the exact design goal of this PR where a upper service system uses `Apache Spark Standalone cluster as an execution subsystem`. The upper service layer already provides many features like the unique appName and security layers. So, there is no such things like `hard to debug` or `minimizing the issue`.
   > why we are allowing explicitly setting an application id, and introducing hard to debug modes; instead of relying on minimizing the issue.
   
   In addition, I already answered with the examples. Let me reiterate that. You can generate a SHS link like `https://shs/history/app-202311140014-0204/` with `appId` while you cannot with `appName`. `appId` is used as a foreign key across Apache Spark systems (Storage like S3 event log and Spark driver logs, SHS link, Spark Master link). It opens a wide range of opportunity to us.
   
   - https://github.com/apache/spark/pull/43743#issuecomment-1806033968
   
   Lastly, this configuration is introduced as `Experimental` as you see because we are already aware of the risk. We don't recommend this configuration for novice users. This is more like automated subsystems in the industrial production usages.
   
   https://github.com/apache/spark/blob/2cac768fabaa7cad40390b2205dd9c5000011e4c/core/src/main/scala/org/apache/spark/internal/config/package.scala#L1852


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1810293165

   In a specific ecosystem, this can be designed away from being an issue (have narrow waist submission layer above spark which ensures uniqueness, among other things) - and so no risk to debugging in that ecosystem.
   Features in Apache Spark are used by all users - where others might not have such guarantees or might not even be aware of these requirement, and my comment about debuggability was in that context: how can a Spark user leverage this experimental feature ? What should they be aware of ? Currently, if they use this feature and there is an issue, as you mentioned behavior would be undefined.
   At a minimum, we should document the expectations/risks.
   
   Thoughts ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #43743: [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled`
URL: https://github.com/apache/spark/pull/43743


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-45756][CORE] Support `spark.master.useAppNameAsAppId.enabled` [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on PR #43743:
URL: https://github.com/apache/spark/pull/43743#issuecomment-1805665081

   What is the behavior if this is turned on and there is a conflict ? Will it result in application submission failure ? Overwriting running app state with new app (or vice versa) ?
   In other words, what is the benefit of doing this ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org