-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32915][CORE] Network-layer and shuffle RPC layer changes to support push shuffle blocks #29855
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
Closed
Closed
[SPARK-32915][CORE] Network-layer and shuffle RPC layer changes to support push shuffle blocks #29855
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
f144936
LIHADOOP-48527 Magnet shuffle service block transfer netty protocol
Victsm 3bb084a
LIHADOOP-53388 Magnet: Fix a bug with calculating bitmap encoded length
zhouyejoe 0781541
LIHADOOP-53438 Using different appId for the tests in RemoteBlockPush…
otterc 7adf227
LIHADOOP-53496 Not logging all block push exceptions on the client
otterc ee75ee9
LIHADOOP-53700 Separate configuration for caching the merged index fi…
zhouyejoe d1f36c0
LIHADOOP-53940 Logging the data file and index file path when shuffle…
otterc aa124b4
LIHADOOP-54059 LIHADOOP-53496 Handle the inconsistencies between loc…
otterc 3f1fb0c
LIHADOOP-54379 Sorting the disks both on shuffle service and executors
otterc bfcb070
LIHADOOP-54370 Not to retry on certain exceptions when pushing blocks
otterc 415a7d5
LIHADOOP-52494 Magnet fallback to origin shuffle blocks when fetch of…
otterc 4381ff3
LIHADOOP-55372 reduced the default for minChunkSizeInMergedShuffleFile
otterc dd9958b
LIHADOOP-55315 Avoid network when fetching merged shuffle file in loc…
zhouyejoe 021dea4
LIHADOOP-55654 Duplicate application init calls trigger NPE and wrong…
zhouyejoe 5ce02d3
Prune changes that should go into a later PR.
Victsm 90d6329
Further prune changes that should go into a later PR.
Victsm 2bdf800
Fix review comments.
Victsm 3e9e9e1
Fix unit test failure.
Victsm eb366d4
Address review comments.
Victsm 7a6ab15
Add more comment.
Victsm 85b0de8
Fix style issue.
Victsm 7b48c50
Add more clarifying comments.
Victsm 9f00cc3
Further optimize the serde of bitmap
Victsm db36f3f
Update common/network-shuffle/src/test/java/org/apache/spark/network/…
Victsm e604686
Address additional review comments
Victsm b45b190
Additional cleanups.
Victsm f11eb9b
Fix additional review comments.
Victsm 691635e
Fix additional review comments
Victsm f016b39
Fix additional review comments.
Victsm 2c95f18
Fix styling issue
Victsm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ErrorHandler.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.network.shuffle; | ||
|
|
||
| import java.net.ConnectException; | ||
|
|
||
| import com.google.common.base.Throwables; | ||
|
|
||
| /** | ||
| * Plugs into {@link RetryingBlockFetcher} to further control when an exception should be retried | ||
| * and logged. | ||
| * Note: {@link RetryingBlockFetcher} will delegate the exception to this handler only when | ||
| * - remaining retries < max retries | ||
| * - exception is an IOException | ||
| */ | ||
|
|
||
| public interface ErrorHandler { | ||
|
|
||
| boolean shouldRetryError(Throwable t); | ||
|
|
||
| default boolean shouldLogError(Throwable t) { | ||
| return true; | ||
| } | ||
|
|
||
| /** | ||
| * A no-op error handler instance. | ||
| */ | ||
| ErrorHandler NOOP_ERROR_HANDLER = t -> true; | ||
|
|
||
| /** | ||
| * The error handler for pushing shuffle blocks to remote shuffle services. | ||
| */ | ||
| class BlockPushErrorHandler implements ErrorHandler { | ||
| /** | ||
| * String constant used for generating exception messages indicating a block to be merged | ||
| * arrives too late on the server side, and also for later checking such exceptions on the | ||
| * client side. When we get a block push failure because of the block arrives too late, we | ||
| * will not retry pushing the block nor log the exception on the client side. | ||
| */ | ||
| public static final String TOO_LATE_MESSAGE_SUFFIX = | ||
| "received after merged shuffle is finalized"; | ||
|
|
||
| /** | ||
| * String constant used for generating exception messages indicating the server couldn't | ||
| * append a block after all available attempts due to collision with other blocks belonging | ||
Victsm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * to the same shuffle partition, and also for later checking such exceptions on the client | ||
| * side. When we get a block push failure because of the block couldn't be written due to | ||
| * this reason, we will not log the exception on the client side. | ||
| */ | ||
| public static final String BLOCK_APPEND_COLLISION_DETECTED_MSG_PREFIX = | ||
| "Couldn't find an opportunity to write block"; | ||
|
|
||
Victsm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @Override | ||
| public boolean shouldRetryError(Throwable t) { | ||
| // If it is a connection time out or a connection closed exception, no need to retry. | ||
| if (t.getCause() != null && t.getCause() instanceof ConnectException) { | ||
jiangxb1987 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return false; | ||
| } | ||
| // If the block is too late, there is no need to retry it | ||
| return !Throwables.getStackTraceAsString(t).contains(TOO_LATE_MESSAGE_SUFFIX); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean shouldLogError(Throwable t) { | ||
| String errorStackTrace = Throwables.getStackTraceAsString(t); | ||
| return !errorStackTrace.contains(BLOCK_APPEND_COLLISION_DETECTED_MSG_PREFIX) && | ||
| !errorStackTrace.contains(TOO_LATE_MESSAGE_SUFFIX); | ||
Victsm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Victsm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.