Uh oh!
There was an error while loading. Please reload this page.
[SPARK-39006][K8S] Show a directional error message for executor PVC dynamic allocation failure - #36374
[SPARK-39006][K8S] Show a directional error message for executor PVC dynamic allocation failure#36374dcoliversun wants to merge 2 commits into
Conversation
AmplabJenkins
commented
Apr 28, 2022
Can one of the admins verify this patch? |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Thank you for changing your direction. This is much better.
| additionalResources.toSeq | ||
| } | ||
| private def checkPVCClaimNameWhenMultiExecutors(claimName: String): Unit = { |
There was a problem hiding this comment.
checkPVCClaimNameWhenMultiExecutors -> checkPVCClaimName because this PR checks all cases instead of WhenMultiExecutors and doesn't raise exception for single instance case.
There was a problem hiding this comment.
Change it as checkPVCClaimName :)
| private def checkPVCClaimNameWhenMultiExecutors(claimName: String): Unit = { | ||
| val invalidClaimName = | ||
| if (!claimName.contains(PVC_ON_DEMAND) && !claimName.contains(ENV_EXECUTOR_ID)) true | ||
| else false |
There was a problem hiding this comment.
This is misleading because this is totally valid when there is only one executor.
There was a problem hiding this comment.
Done, check it when multiple executors
| else false | ||
| val executorInstances = conf.get(EXECUTOR_INSTANCES) | ||
| if (executorInstances.isEmpty) return |
There was a problem hiding this comment.
Please try to avoid return in Scala method.
| if (invalidClaimName && executorInstances.get > 1) { | ||
| throw new IllegalArgumentException("PVC ClaimName should contain " + | ||
| PVC_ON_DEMAND + " or " + ENV_EXECUTOR_ID + | ||
| " when multiple executors are required") |
There was a problem hiding this comment.
The error message looks informative but please include the current claim name in the error message too.
There was a problem hiding this comment.
Have added the current claim name
| assert(executorPVC.getClaimName.endsWith("-exec-1-pvc-0")) | ||
| } | ||
| test("SPARK-39006 Show a directional error message for PVC Dynamic Allocation Failure") { |
There was a problem hiding this comment.
- We need
:, e.g.,SPARK-39006->SPARK-39006:. - After this PR, we don't have PVC Dynamic Allocation Failure. Please revise the test case.
There was a problem hiding this comment.
Have two changes here:
- Add
:afterSPARK-39006 - Change test case as
Check PVC ClaimName
| mountReadOnly = true, | ||
| KubernetesPVCVolumeConf("testClaimName") | ||
| ) | ||
| val conf = new SparkConf().set(EXECUTOR_INSTANCES, 2) |
There was a problem hiding this comment.
Please add a positive test case where executor instance is 1.
There was a problem hiding this comment.
Fine, added a positive test here
dongjoon-hyun
left a comment
There was a problem hiding this comment.
I left a few comments. Thanks, @dcoliversun .
dcoliversun
commented
Apr 29, 2022
@dongjoon-hyun Thanks for your comments, I have updated code. Please review again |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM. Thank you, @dcoliversun .
Merged to master for Apache Spark 3.4.
dcoliversun
commented
May 8, 2022
Thank you @dongjoon-hyun |
0xdarkman
commented
Jun 20, 2023
can we expect the fix to be in next spark version release 3.4.1? |
dongjoon-hyun
commented
Jun 20, 2023
Could you be more specific, @0xdarkman ? Which JIRA do you want for Apache Spark 3.4.1? You can check Apache Spark 3.4.1 RC1 vote for the detail. |
dongjoon-hyun
commented
Jun 20, 2023
For this PR (SPARK-39006), it's reverted cleanly via SPARK-43342 at Apache Spark 3.4.1. |
I have been migrating from spark 3.3.2 and deployed spark 3.4.0 and had error with PVC ReadWriteMany access so this is how I come across this issue. if it is fix, change reverted or whatever it does not matter to me as far as I can use new spark version with PVC access similarly to what spark version did prior v 3.4.0. |
Could you try Apache Spark 3.4.1 in advance? RC1 binary is already there and the vote will finished in 24 hours.
If you can participate the community vote, it would be great, @0xdarkman . |
0xdarkman
commented
Jun 23, 2023
I am running this version 3.4.1 and it looks good. |
dongjoon-hyun
commented
Jun 24, 2023
Thank you for confirming. Apache Spark 3.4.1 is released officially. |
What changes were proposed in this pull request?
This PR aims to show a directional error message for executor PVC dynamic allocation failure.
Why are the changes needed?
#29846 supports dynamic PVC creation/deletion for K8s executors.
#29557 support execId placeholder in executor PVC conf.
If not set
spark.kubernetes.executor.volumes.persistentVolumeClaim.spark-local-dir-1.options.claimNamewithonDemandorSPARK_EXECUTOR_ID, spark will continue to try to create the executor pod.After this PR, spark can show a directional error message for this situation.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Add unit test.