-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25341][Core] Support rolling back a shuffle map stage and re-generate the shuffle files #25620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-25341][Core] Support rolling back a shuffle map stage and re-generate the shuffle files #25620
Changes from 1 commit
bbce8b4
578c233
cb612e5
f4471b2
b31d1f5
ff8fde9
2bb4388
061e363
212b201
0d91544
da73b56
69d59a1
c86f6cc
d2215b2
28c9f9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,7 +172,7 @@ public ManagedBuffer getBlockData( | |
| String appId, | ||
| String execId, | ||
| int shuffleId, | ||
| int mapId, | ||
| long mapId, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @xuanyuanking why change this from int to long? Is it possible that a mapId can be greater than 2^31?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. previous the map id is the index of the mapper, and can get conflicts when we re-run the task. Now the map id is the task id, which is unique. task id needs to be long.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, after this patch, we set mapId by using the |
||
| int reduceId) { | ||
| ExecutorShuffleInfo executor = executors.get(new AppExecId(appId, execId)); | ||
| if (executor == null) { | ||
|
|
@@ -296,7 +296,7 @@ private void deleteNonShuffleServiceServedFiles(String[] dirs) { | |
| * and the block id format is from ShuffleDataBlockId and ShuffleIndexBlockId. | ||
| */ | ||
| private ManagedBuffer getSortBasedShuffleBlockData( | ||
| ExecutorShuffleInfo executor, int shuffleId, int mapId, int reduceId) { | ||
| ExecutorShuffleInfo executor, int shuffleId, long mapId, int reduceId) { | ||
| File indexFile = ExecutorDiskUtils.getFile(executor.localDirs, executor.subDirsPerLocalDir, | ||
| "shuffle_" + shuffleId + "_" + mapId + "_0.index"); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,9 +40,7 @@ public interface ShuffleExecutorComponents { | |
| /** | ||
| * Called once per map task to create a writer that will be responsible for persisting all the | ||
| * partitioned bytes written by that map task. | ||
| * | ||
xuanyuanking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * @param shuffleId Unique identifier for the shuffle the map task is a part of | ||
| * @param mapId Within the shuffle, the identifier of the map task | ||
| * @param mapTaskAttemptId Identifier of the task attempt. Multiple attempts of the same map task | ||
| * with the same (shuffleId, mapId) pair can be distinguished by the | ||
| * different values of mapTaskAttemptId. | ||
|
|
@@ -51,7 +49,6 @@ public interface ShuffleExecutorComponents { | |
| */ | ||
| ShuffleMapOutputWriter createMapOutputWriter( | ||
| int shuffleId, | ||
| int mapId, | ||
| long mapTaskAttemptId, | ||
|
||
| int numPartitions) throws IOException; | ||
|
|
||
|
|
@@ -64,14 +61,12 @@ ShuffleMapOutputWriter createMapOutputWriter( | |
| * preserving an optimization in the local disk shuffle storage implementation. | ||
| * | ||
| * @param shuffleId Unique identifier for the shuffle the map task is a part of | ||
| * @param mapId Within the shuffle, the identifier of the map task | ||
| * @param mapTaskAttemptId Identifier of the task attempt. Multiple attempts of the same map task | ||
| * with the same (shuffleId, mapId) pair can be distinguished by the | ||
| * different values of mapTaskAttemptId. | ||
| */ | ||
| default Optional<SingleSpillShuffleMapOutputWriter> createSingleFileMapOutputWriter( | ||
| int shuffleId, | ||
| int mapId, | ||
| long mapTaskAttemptId) throws IOException { | ||
| return Optional.empty(); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should one long[] for map id and one int[] for reduce id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we already have long[] for map id and int[] for reduce id in the message, here we need is kinda assemble work to flatten reduce id and its corresponding mapid.
The current way waste memory, we can also do it in a cpu consuming way, which is for each index, calculate which map id and reduce id corresponding with the
idx.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After taking a further look, I split the new protocol managed buffer iterator in
539d725, that make us more flexible to control the iterator and no more array created.