Skip to content
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-37675][CORE][SHUFFLE] Return PushMergedRemoteMetaFailedFetchResult if no available push-merged block #34934

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private class PushBasedFetchHelper(
for (i <- bitmaps.indices) {
val blockChunkId = ShuffleBlockChunkId(shuffleId, shuffleMergeId, reduceId, i)
chunksMetaMap.put(blockChunkId, bitmaps(i))
logDebug(s"adding block chunk $blockChunkId of size $approxChunkSize")
logDebug(s"Adding block chunk $blockChunkId of size $approxChunkSize")
blocksToFetch += ((blockChunkId, approxChunkSize, SHUFFLE_PUSH_MAP_ID))
}
blocksToFetch
Expand All @@ -145,16 +145,23 @@ private class PushBasedFetchHelper(
logDebug(s"Received the meta of push-merged block for ($shuffleId, $shuffleMergeId," +
s" $reduceId) from ${req.address.host}:${req.address.port}")
try {
iterator.addToResultsQueue(PushMergedRemoteMetaFetchResult(shuffleId, shuffleMergeId,
reduceId, sizeMap((shuffleId, reduceId)), meta.readChunkBitmaps(), address))
val bitmaps = meta.readChunkBitmaps()
if (bitmaps.nonEmpty) {
iterator.addToResultsQueue(PushMergedRemoteMetaFetchResult(shuffleId, shuffleMergeId,
reduceId, sizeMap((shuffleId, reduceId)), bitmaps, address))
} else {
logInfo(s"No available push-merged block for ($shuffleId, $shuffleMergeId," +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...I thought we only raise the merged status request when there are merged blocks. Because we ensured this when fetching merge status:

val remainingMapStatuses = if (mergeStatus != null && mergeStatus.totalSize > 0) {

But why bitmaps could be empty here? cc @mridulm @otterc

s" $reduceId) from ${req.address.host}:${req.address.port}")
iterator.addToResultsQueue(
PushMergedRemoteMetaFailedFetchResult(shuffleId, shuffleMergeId, reduceId, address))
}
} catch {
case exception: Exception =>
logError(s"Failed to parse the meta of push-merged block for ($shuffleId, " +
s"$shuffleMergeId, $reduceId) from" +
s" ${req.address.host}:${req.address.port}", exception)
iterator.addToResultsQueue(
PushMergedRemoteMetaFailedFetchResult(shuffleId, shuffleMergeId, reduceId,
address))
PushMergedRemoteMetaFailedFetchResult(shuffleId, shuffleMergeId, reduceId, address))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,9 @@ final class ShuffleBlockFetcherIterator(

case PushMergedRemoteMetaFetchResult(
shuffleId, shuffleMergeId, reduceId, blockSize, bitmaps, address) =>
// PushMergedRemoteMetaFailedFetchResult will be returned instead of
// PushMergedRemoteMetaFetchResult if no available push-merged block.
assert(bitmaps.length > 0)
// The original meta request is processed so we decrease numBlocksToFetch and
// numBlocksInFlightPerAddress by 1. We will collect new shuffle chunks request and the
// count of this is added to numBlocksToFetch in collectFetchReqsFromMergedBlocks.
Expand Down