Uh oh!
There was an error while loading. Please reload this page.
[SPARK-27194][SPARK-29302][SQL] Define a spark staging committer to resolve FileAlreadyExistingException - #28989
[SPARK-27194][SPARK-29302][SQL] Define a spark staging committer to resolve FileAlreadyExistingException#28989turboFei wants to merge 4 commits into
Conversation
gentle ping @cloud-fan Hi, we found a new solution to fix the issues when dynamic partition overwrite is enabled.
In this PR, we define a new type of OutputCommitter and leverage the OutputCommitCoordinator to coordinate the task commits. |
turboFei
commented
Jul 3, 2020
aslo cc @Ngone51 |
turboFei
commented
Jul 6, 2020
dongjoon-hyun
commented
Jul 6, 2020
ok to test |
SparkQA
commented
Jul 6, 2020
Test build #125132 has started for PR 28989 at commit |
shaneknapp
commented
Jul 6, 2020
test this please |
SparkQA
commented
Jul 7, 2020
Test build #125143 has finished for PR 28989 at commit
|
turboFei
commented
Jul 7, 2020
will try to fix it. |
…solve file already exist exception
SparkQA
commented
Jul 7, 2020
Test build #125196 has finished for PR 28989 at commit
|
SparkQA
commented
Jul 7, 2020
Test build #125205 has finished for PR 28989 at commit
|
SparkQA
commented
Jul 7, 2020
Test build #125212 has finished for PR 28989 at commit
|
SparkQA
commented
Jul 8, 2020
Test build #125275 has finished for PR 28989 at commit
|
turboFei
commented
Jul 9, 2020
close this, Prefer to #29000 |
What changes were proposed in this pull request?
For dynamic partition overwrite, its working dir is
.spark-staging-{jobId}.Task file name formatted
part-$taskId-$jobId$ext(regardless task attempt Id).Each task writes its output to:
.spark-staging-{jobId}/partitionPath1/taskFileName1.spark-staging-{jobId}/partitionPath2/taskFileName2.spark-staging-{jobId}/partitionPathN/taskFileNameNIf speculation is enabled, there may be several tasks, which have same taskId and different attemptId, write to the same files concurrently.
For distributedFileSystem, it only allow one task to hold the lease to write a file, if two tasks want to write the same file, an exception like
no lease on inodewould be thrown.Even speculation is not enabled, if a task aborted due to Executor OOM, its output would not be cleaned up.
Then a new task launched to write the same file, because parquet disallows overwriting, a
FileAlreadyExistsExceptionwould be thrown, like.It is a critical issue and would cause job failed.
In this Pr, we define a spark staging output committer to fix this issue:
Why are the changes needed?
Without this PR, dynamic partition overwrite operation might fail.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added UT.