-
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 |
|---|---|---|
|
|
@@ -165,21 +165,21 @@ public void registerExecutor( | |
| } | ||
|
|
||
| /** | ||
| * Obtains a FileSegmentManagedBuffer from (shuffleId, mapTaskId, reduceId). We make assumptions | ||
| * Obtains a FileSegmentManagedBuffer from (shuffleId, mapId, reduceId). We make assumptions | ||
| * about how the hash and sort based shuffles store their data. | ||
| */ | ||
| public ManagedBuffer getBlockData( | ||
| String appId, | ||
| String execId, | ||
| int shuffleId, | ||
| long mapTaskId, | ||
| 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) { | ||
| throw new RuntimeException( | ||
| String.format("Executor is not registered (appId=%s, execId=%s)", appId, execId)); | ||
| } | ||
| return getSortBasedShuffleBlockData(executor, shuffleId, mapTaskId, reduceId); | ||
| return getSortBasedShuffleBlockData(executor, shuffleId, mapId, reduceId); | ||
| } | ||
|
|
||
| public ManagedBuffer getRddBlockData( | ||
|
|
@@ -291,23 +291,22 @@ private void deleteNonShuffleServiceServedFiles(String[] dirs) { | |
| } | ||
|
|
||
| /** | ||
| * Sort-based shuffle data uses an index called "shuffle_ShuffleId_MapTaskId_0.index" into a data | ||
| * file called "shuffle_ShuffleId_MapTaskId_0.data". | ||
| * This logic is from IndexShuffleBlockResolver, and the block id format is from | ||
| * ShuffleDataBlockId and ShuffleIndexBlockId. | ||
| * Sort-based shuffle data uses an index called "shuffle_ShuffleId_MapId_0.index" into a data file | ||
| * called "shuffle_ShuffleId_MapId_0.data". This logic is from IndexShuffleBlockResolver, | ||
| * and the block id format is from ShuffleDataBlockId and ShuffleIndexBlockId. | ||
| */ | ||
| private ManagedBuffer getSortBasedShuffleBlockData( | ||
| ExecutorShuffleInfo executor, int shuffleId, long mapTaskId, int reduceId) { | ||
| ExecutorShuffleInfo executor, int shuffleId, long mapId, int reduceId) { | ||
| File indexFile = ExecutorDiskUtils.getFile(executor.localDirs, executor.subDirsPerLocalDir, | ||
| "shuffle_" + shuffleId + "_" + mapTaskId + "_0.index"); | ||
| "shuffle_" + shuffleId + "_" + mapId + "_0.index"); | ||
|
|
||
| try { | ||
| ShuffleIndexInformation shuffleIndexInformation = shuffleIndexCache.get(indexFile); | ||
| ShuffleIndexRecord shuffleIndexRecord = shuffleIndexInformation.getIndex(reduceId); | ||
| return new FileSegmentManagedBuffer( | ||
| conf, | ||
| ExecutorDiskUtils.getFile(executor.localDirs, executor.subDirsPerLocalDir, | ||
| "shuffle_" + shuffleId + "_" + mapTaskId + "_0.data"), | ||
| "shuffle_" + shuffleId + "_" + mapId + "_0.data"), | ||
| shuffleIndexRecord.getOffset(), | ||
| shuffleIndexRecord.getLength()); | ||
| } catch (ExecutionException e) { | ||
|
|
||
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.
Shall we add check logic here to be safe?
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.
Does Xingbo mean a double check here? Basically there's existing checking for both the length and non-empty.
spark/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/FetchShuffleBlocks.java
Line 51 in 36f8e53
spark/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java
Lines 88 to 90 in 36f8e53
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.
Yea if the place is not super performance critical I'd prefer a double check here.
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.
Sure, done the double-check in 00e78b2.