[#825][part-4] feat(spark): Report write failures to ShuffleManager - #1258
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1258 +/- ##
============================================
+ Coverage 53.70% 54.43% +0.72%
Complexity 2655 2655
============================================
Files 398 380 -18
Lines 23157 20933 -2224
Branches 1976 1985 +9
============================================
- Hits 12437 11395 -1042
+ Misses 9954 8843 -1111
+ Partials 766 695 -71
... and 20 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
95e7823 to
2c6acb4
Compare
|
@jerqi @leixm Please look at it for me. |
|
LGTM, @jerqi Please take a look. |
| shuffleId, | ||
| key -> | ||
| new ShuffleServerFailureRecord(shuffleServerInfoIntegerMap, stageAttemptNumber)); | ||
| int c = shuffleServerFailureRecord.resetStageAttemptIfNecessary(stageAttemptNumber); |
There was a problem hiding this comment.
Could we give this variable a better name?
| List<ShuffleServerInfo> shuffleServerInfos, | ||
| RssShuffleManagerInterface shuffleManager) { | ||
| return withWriteLock( | ||
| () -> { |
There was a problem hiding this comment.
if (this.stageAttemptNumber != stageAttemptNumber) {
// do nothing here
return false;
}
shuffleServerInfos.forEach(
shuffleServerInfo -> {
shuffleServerFailureRecordCount
.computeIfAbsent(shuffleServerInfo.getId(), k -> new AtomicInteger())
.incrementAndGet();
});
List<Map.Entry<String, AtomicInteger>> list =
new ArrayList(shuffleServerFailureRecordCount.entrySet());
Collections.sort(list, (o1, o2) -> (o1.getValue().get() - o2.getValue().get()));
Map.Entry<String, AtomicInteger> shuffleServerInfoIntegerEntry = list.get(0);
if (shuffleServerInfoIntegerEntry.getValue().get()
> shuffleManager.getMaxFetchFailures()) {
shuffleManager.addFailuresShuffleServerInfos(
shuffleServerInfoIntegerEntry.getKey());
return true;
}
return false;
More clear.
| return withReadLock(() -> this.stageAttemptNumber); | ||
| } | ||
|
|
||
| public int resetStageAttemptIfNecessary(int stageAttemptNumber) { |
There was a problem hiding this comment.
Could we return bool type here?
There was a problem hiding this comment.
Could we return
booltype here?
Have been changed.
| this.stageAttemptNumber = stageAttemptNumber; | ||
| } | ||
|
|
||
| private <T> T withReadLock(Supplier<T> fn) { |
There was a problem hiding this comment.
These methods seems useful. Could we extract some methods for other classes to use?
There was a problem hiding this comment.
These methods seems useful. Could we extract some methods for other classes to use?
Later PR will use this method.
26b7c05 to
83a8338
Compare
83a8338 to
59b58e1
Compare
|
Waiting for UTs. |
|
Merged, thanks @jerqi @yl09099 |
What changes were proposed in this pull request?
Send the write exception to the ShuffleServer to the ShuffleManager.
Ⅰ. 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?
Fix: #825
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing UT.