Uh oh!
There was an error while loading. Please reload this page.
[SPARK-27194][SPARK-29302][SQL] For dynamic partition overwrite operation, fix speculation task conflict issue and FileAlreadyExistsException issue - #26339
Conversation
cc @cloud-fan@advancedxy@viirya@wangyum |
turboFei
commented
Nov 7, 2019
gentle ping @cloud-fan@advancedxy@viirya |
turboFei
commented
Nov 13, 2019
gentle ping @cloud-fan@advancedxy@viirya Could you help take a look? Thanks in advance! |
dbtsai
commented
Nov 18, 2019
Jenkins, okay to test. |
turboFei
commented
Nov 19, 2019
retest this please. |
Uh oh!
There was an error while loading. Please reload this page.
dongjoon-hyun
commented
Dec 11, 2019
ok to test |
SparkQA
commented
Dec 12, 2019
Test build #115200 has finished for PR 26339 at commit
|
SparkQA
commented
Dec 12, 2019
Test build #115221 has finished for PR 26339 at commit
|
turboFei
commented
Dec 12, 2019
@dongjoon-hyun test passed. Could you help take a look? thanks in advance! |
turboFei
commented
Dec 16, 2019
gentle ping @dongjoon-hyun@dbtsai@viirya |
ramesh-muthusamy
commented
Dec 16, 2019
@turboFei do we have test cases to capture the changes. |
turboFei
commented
Dec 18, 2019
I'll try my best to think how to add UT. |
| val fileName = stagingTaskFile.getName | ||
| val taskPartitionPath = getPartitionPath(stagingTaskFile) | ||
| val destFile = new Path(new Path(stagingDir, taskPartitionPath), fileName) | ||
| fs.rename(stagingTaskFile, destFile) |
There was a problem hiding this comment.
fs.rename returns boolean in specific cases , please handle the same.
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
dongjoon-hyun
commented
Mar 30, 2020
Can we have a test case for this PR? |
dongjoon-hyun
commented
Mar 30, 2020
ok to test |
SparkQA
commented
Mar 30, 2020
Test build #120566 has finished for PR 26339 at commit
|
venkata91
commented
Mar 31, 2020
@dongjoon-hyun@turboFei Is this PR still being worked on? We are having similar issues in our platform for a while, it would be great if we can get this fixed soon. |
turboFei
commented
Apr 1, 2020
I will follow it. But I am confused that how to add an UT. |
tried to add an ut. |
turboFei
commented
Apr 3, 2020
cc @Ngone51 |
SparkQA
commented
Apr 3, 2020
Test build #120775 has finished for PR 26339 at commit
|
SparkQA
commented
Apr 3, 2020
Test build #120782 has finished for PR 26339 at commit
|
turboFei
commented
May 6, 2020
gentle ping @dongjoon-hyun@cloud-fan@gatorsmile@HyukjinKwon |
| dir.map { d => | ||
| new Path(new Path(stagingDir, d), filename).toString | ||
| if (dynamicPartitionOverwrite) { | ||
| val tempFile = new Path(dynamicStagingTaskPath(dir.get, taskContext), filename) |
ping @cloud-fan I think the solution given in this PR could work for the issue. |
SparkQA
commented
May 6, 2020
Test build #122368 has finished for PR 26339 at commit
|
maropu
commented
May 6, 2020
retest this please |
SparkQA
commented
May 7, 2020
Test build #122382 has finished for PR 26339 at commit
|
SparkQA
commented
May 8, 2020
Test build #122437 has finished for PR 26339 at commit
|
SparkQA
commented
May 8, 2020
Test build #122438 has finished for PR 26339 at commit
|
turboFei
commented
May 12, 2020
@jerryshao@cloud-fan could you help review this pr? It can help resolve a critical issue. thanks in advance. |
turboFei
commented
May 12, 2020
also cc @jiangxb1987 |
HyukjinKwon
commented
May 13, 2020
also cc @vanzin |
koertkuipers
commented
May 22, 2020
i am getting worried now this wont make it into spark 3.0.0 |
@koertkuipers you could send your concern to the vote of Spark 3.0 release and see if PMC/committer would consider it as release blocker or not. |
koertkuipers
commented
May 22, 2020
@Ngone51 yeah i thought about doing that, but i dont want to slowdown the spark 3 release even more (and this is not a regression i guess?). now i am just hoping someone sees my messages here and reviews this before spark 3.0.0 rc3! |
Ngone51
commented
May 22, 2020
The vote thread now has more eys on than this PR and as you know this PR is somehow overlooked for a while. |
…ion overwrite a task would conflict with its speculative task
SparkQA
commented
Jun 18, 2020
Test build #124203 has finished for PR 26339 at commit
|
dongjoon-hyun
commented
Jun 22, 2020
Retest this please |
SparkQA
commented
Jun 22, 2020
Test build #124343 has finished for PR 26339 at commit
|
LuciferYang
commented
Jun 30, 2020
@dongjoon-hyun@turboFei Is this PR still being worked on? We are having similar issues in our production environment, and I found there are similar PRs try to solve this problem, such as #26090, #26971 |
turboFei
commented
Jun 30, 2020
Gentle ping @dongjoon-hyun@dbtsai |
turboFei
commented
Jul 3, 2020
close this and will a create a new pr with new solution. thanks |
koertkuipers
commented
Jul 3, 2020
why close this? did you find a better approach? |
Hi, here is the new patch. |
koertkuipers
commented
Jul 3, 2020
thank you. curious why you changed direction... if there is anything wrong with approach in this pullreq? we were just about to start testing it at scale that's why i ask. |
turboFei
commented
Jul 3, 2020
In the origin solution, when renaming staging task file to final file. It is tricky that the final files may from different tasks. If the task output for a partition has multi files(or bucket table insert case), the data might be corrupted. So, we need outputCommitCoordinator to help decide which task can commit. In the new solution, we define a new output committer to leverage outputCommitCoordinator(by invoking SparkHadoopMapRedUtil.commitTask) |
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 fix this issue with the solution below:
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.