otterc commented on a change in pull request #34074:
URL: https://github.com/apache/spark/pull/34074#discussion_r779164683
##########
File path:
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RemoteBlockPushResolver.java
##########
@@ -904,13 +933,15 @@ public void onComplete(String streamId) throws
IOException {
// the error code to the client.
AppShuffleMergePartitionsInfo info =
appShuffleInfo.shuffles.get(partitionInfo.shuffleId);
if (isTooLate(info, partitionInfo.reduceId)) {
- deferredBufs = null;
+ freeAnyDeferredBlocks();
+ mergeManager.pushMergeMetrics.tooLateResponses.mark();
throw new BlockPushNonFatalFailure(
new BlockPushReturnCode(ReturnCode.TOO_LATE_BLOCK_PUSH.id(),
streamId).toByteBuffer(),
BlockPushNonFatalFailure.getErrorMsg(streamId,
ReturnCode.TOO_LATE_BLOCK_PUSH));
}
if (isStale(info, partitionInfo.shuffleMergeId)) {
- deferredBufs = null;
+ freeAnyDeferredBlocks();
+ mergeManager.pushMergeMetrics.noOpportunityResponses.mark();
Review comment:
`couldNotFindOpportunityResponses` is to keep track of how many times a
shuffle block collided because another block for the same reduce partition was
being written. A stale block is different. It's from an executor that's from a
previous app attempt/stage attempt. I don't think we should club them together.
I don't think capturing how many stale blocks is that useful.
cc. @Ngone51 @mridulm
##########
File path:
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RemoteBlockPushResolver.java
##########
@@ -1410,4 +1442,42 @@ long getPos() {
return pos;
}
}
+
+ /**
+ * A class that wraps all the push-based metrics.
+ */
+ static class PushMergeMetrics implements MetricSet {
+ static final String NO_OPPORTUNITY_RESPONSES_METRIC =
"couldNotFindOpportunityResponses";
+ static final String TOO_LATE_RESPONSES_METRIC = "tooLateResponses";
+ static final String PUSHED_BYTES_WRITTEN_METRIC = "pushedBytesWritten";
+ static final String CACHED_BLOCKS_BYTES_METRIC = "cachedBlocksBytes";
+
+ private final Map<String, Metric> allMetrics;
+ private final Meter noOpportunityResponses;
+ private final Meter tooLateResponses;
+ private final Meter pushedBytesWritten;
+ private final Counter cachedBlockBytes;
Review comment:
We should document what these metrics mean?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]