Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/9610#discussion_r44497573
--- Diff:
core/src/main/scala/org/apache/spark/shuffle/hash/HashShuffleWriter.scala ---
@@ -106,6 +108,19 @@ private[spark] class HashShuffleWriter[K, V](
writer.commitAndClose()
writer.fileSegment().length
}
+ // rename all shuffle files to final paths
+ shuffle.writers.zip(sizes).foreach { case (writer:
DiskBlockObjectWriter, size: Long) =>
+ if (size > 0) {
+ val output = blockManager.diskBlockManager.getFile(writer.blockId)
+ if (output.exists()) {
+ writer.file.delete()
+ } else {
+ if (!writer.file.renameTo(output)) {
+ throw new IOException(s"fail to rename ${writer.file} to
$output")
--- End diff --
same problem here on partially existing shuffle output. Also, the `if
(size > 0)` check will lead to inconsistencies if you have non-deterministic
shuffle output -- it might be true for different partitions in different
attempts. I think it can be OK in any case, as long as the MapStatus is
consistent.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]