[#825][part-2] feat(spark): Report failed blocks and a list of ShuffleServer - #1138
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1138 +/- ##
============================================
+ Coverage 54.55% 54.58% +0.02%
Complexity 2613 2613
============================================
Files 375 375
Lines 20224 20307 +83
Branches 1930 1932 +2
============================================
+ Hits 11033 11084 +51
- Misses 8526 8554 +28
- Partials 665 669 +4
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
bf311fa to
065a7ba
Compare
| return; | ||
| } | ||
| taskToFailedBlockIdsAndServer | ||
| .computeIfAbsent(taskAttemptId, x -> Maps.newConcurrentMap()) |
There was a problem hiding this comment.
JavaUtils.newConcurrentMap()?
| public Map<Long, List<ShuffleServerInfo>> getFailedBlockIdsWithShuffleServer(String taskId) { | ||
| Map<Long, List<ShuffleServerInfo>> result = taskToFailedBlockIdsAndServer.get(taskId); | ||
| if (result == null) { | ||
| result = Maps.newHashMap(); |
| // if send block failed, the task will fail | ||
| // todo: better to have fallback solution when send to multiple servers | ||
| /** Records the ShuffleServer that successfully or failed to send blocks */ | ||
| Map<Long, List<ShuffleServerInfo>> blockIdSendSuccessTracker = Maps.newConcurrentMap(); |
6fdbd28 to
406c285
Compare
|
@leixm Could you help me review this pr? |
| .addAll(blockIds); | ||
| } | ||
|
|
||
| private synchronized void putBlockIdAndShuffle( |
There was a problem hiding this comment.
- Could we give this method a better name? I can't get the point of
put shuffle. - Will it influence the performance of pusher if we use the lock here?
There was a problem hiding this comment.
- Could we give this method a better name? I can't get the point of
put shuffle.- Will it influence the performance of pusher if we use the lock here?
- The name has been changed.
- The lock here is the same logic as the putBlockId method above and should not affect it.
cf24af4 to
0500a29
Compare
advancedxy
left a comment
There was a problem hiding this comment.
Generally lgtm, except one minor comment.
| return new SendShuffleDataResult( | ||
| Sets.newHashSet(2L), Sets.newHashSet(1L), Maps.newHashMap()); |
There was a problem hiding this comment.
I don't think this line is needed? Since the constructor of SentShuffleDataResult is kept for compatibility.
There was a problem hiding this comment.
I don't think this line is needed? Since the constructor of
SentShuffleDataResultis kept for compatibility.
Have been modified.
| successBlockIds.add(blockInfo.getBlockId()); | ||
| } | ||
| return new SendShuffleDataResult(successBlockIds, Sets.newHashSet()); | ||
| return new SendShuffleDataResult(successBlockIds, Sets.newHashSet(), Maps.newHashMap()); |
| * @param taskId Shuffle taskId | ||
| * @return List of failed ShuffleServer blocks | ||
| */ | ||
| public Map<Long, List<ShuffleServerInfo>> getFailedBlockIdsWithShuffleServer(String taskId) { |
There was a problem hiding this comment.
when is this method called?
And it seems a bit unusual to return an empty map without putting it back to the taskToFailedBlockIdsAndServer.
There was a problem hiding this comment.
when is this method called?
And it seems a bit unusual to return an empty map without putting it back to the
taskToFailedBlockIdsAndServer.
Later PR will call this method.
| // todo: better to have fallback solution when send to multiple servers | ||
| /** Records the ShuffleServer that successfully or failed to send blocks */ | ||
| Map<Long, List<ShuffleServerInfo>> blockIdSendSuccessTracker = JavaUtils.newConcurrentMap(); | ||
| Map<Long, List<ShuffleServerInfo>> blockIdsSendFailTracker = JavaUtils.newConcurrentMap(); |
There was a problem hiding this comment.
Reminder: let's review the memory usage for this change after all the code has been finished.
I'm a bit of worried about the memory overhead.
There was a problem hiding this comment.
It seems not. The ShuffleServerInfo object in the map is reused.
|
+1 LGTM. |
9c4a069 to
98b0d12
Compare
roryqi
left a comment
There was a problem hiding this comment.
LGTM, thanks @advancedxy @yl09099 @leixm
What changes were proposed in this pull request?
The ShuffleServer corresponding to the block that failed to be sent needs to be reported.
Ⅰ. Overall objective:
Ⅱ. Implementation logic diagram:
Ⅲ. As shown in the picture above:
2, the Task of Stage starts, solid steps, in accordance with the green by ShuffleManager Client RPC interface gets to be written for shuffleIdToShuffleHandleInfo ShuffleServer list;
Why are the changes needed?
Reports the ShuffleServer corresponding to the block that failed to be sent
Fix: #825
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing UT