-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-36206][CORE] Support shuffle data corruption diagnosis via shuffle checksum #33451
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
Changes from all commits
7b40e2e
3cdd858
4c01069
7bd3788
8eb667f
8015e86
b25914d
03b26fe
10d60f8
b0b17ab
c3dcef0
a8f15bd
815fdf6
f193368
dfb594d
30ed389
c70fa09
94576d1
e606ca6
acf20cf
895aad5
91610b0
6e5d2c0
993ea3d
e2e5fa0
c407962
1b612a2
3a41a92
cab36a2
1292390
8610333
47764e3
c041f01
4cd8350
2da1b91
95ef9db
925491c
73b7b70
be116fb
64071ee
a994c0d
261f5ec
8d9db93
6f72ab1
e5e58d5
7e4c91d
67262c9
ca1b058
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,8 @@ | |
|
|
||
| import org.apache.spark.network.buffer.FileSegmentManagedBuffer; | ||
| import org.apache.spark.network.buffer.ManagedBuffer; | ||
| import org.apache.spark.network.shuffle.checksum.Cause; | ||
| import org.apache.spark.network.shuffle.checksum.ShuffleChecksumHelper; | ||
| import org.apache.spark.network.shuffle.protocol.ExecutorShuffleInfo; | ||
| import org.apache.spark.network.util.LevelDBProvider; | ||
| import org.apache.spark.network.util.LevelDBProvider.StoreVersion; | ||
|
|
@@ -374,6 +376,29 @@ public Map<String, String[]> getLocalDirs(String appId, Set<String> execIds) { | |
| .collect(Collectors.toMap(Pair::getKey, Pair::getValue)); | ||
| } | ||
|
|
||
| /** | ||
| * Diagnose the possible cause of the shuffle data corruption by verifying the shuffle checksums | ||
| */ | ||
| public Cause diagnoseShuffleBlockCorruption( | ||
| String appId, | ||
| String execId, | ||
| int shuffleId, | ||
| long mapId, | ||
| int reduceId, | ||
| long checksumByReader, | ||
| String algorithm) { | ||
| ExecutorShuffleInfo executor = executors.get(new AppExecId(appId, execId)); | ||
| // This should be in sync with IndexShuffleBlockResolver.getChecksumFile | ||
| String fileName = "shuffle_" + shuffleId + "_" + mapId + "_0.checksum." + algorithm; | ||
Ngone51 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| File checksumFile = ExecutorDiskUtils.getFile( | ||
| executor.localDirs, | ||
| executor.subDirsPerLocalDir, | ||
| fileName); | ||
|
||
| ManagedBuffer data = getBlockData(appId, execId, shuffleId, mapId, reduceId); | ||
| return ShuffleChecksumHelper.diagnoseCorruption( | ||
| algorithm, checksumFile, reduceId, data, checksumByReader); | ||
| } | ||
|
|
||
| /** Simply encodes an executor's full ID, which is appId + execId. */ | ||
| public static class AppExecId { | ||
| public final String appId; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /* | ||
| * 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.checksum; | ||
|
|
||
| /** | ||
| * The cause of shuffle data corruption. | ||
| */ | ||
| public enum Cause { | ||
| DISK_ISSUE, NETWORK_ISSUE, UNKNOWN_ISSUE, CHECKSUM_VERIFY_PASS, UNSUPPORTED_CHECKSUM_ALGORITHM | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.