forked from apache/celeborn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CELEBORN-1071] Support stage rerun for shuffle data lost
### What changes were proposed in this pull request? If shuffle data is lost and enabled throw fetch failures, triggered stage rerun. ### Why are the changes needed? Rerun stage for shuffle lost scenarios. ### Does this PR introduce _any_ user-facing change? NO. ### How was this patch tested? GA. Closes apache#2894 from FMX/b1701. Authored-by: mingji <[email protected]> Signed-off-by: Shuang <[email protected]> (cherry picked from commit 42d5d42) Signed-off-by: Shuang <[email protected]>
- Loading branch information
Showing
5 changed files
with
130 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
71 changes: 71 additions & 0 deletions
71
tests/spark-it/src/test/scala/org/apache/celeborn/tests/spark/CelebornShuffleLostSuite.scala
This file contains 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,71 @@ | ||
/* | ||
* 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.celeborn.tests.spark | ||
|
||
import org.apache.spark.SparkConf | ||
import org.apache.spark.sql.SparkSession | ||
import org.scalatest.BeforeAndAfterEach | ||
import org.scalatest.funsuite.AnyFunSuite | ||
|
||
import org.apache.celeborn.client.ShuffleClient | ||
import org.apache.celeborn.common.protocol.ShuffleMode | ||
|
||
class CelebornShuffleLostSuite extends AnyFunSuite | ||
with SparkTestBase | ||
with BeforeAndAfterEach { | ||
|
||
override def beforeEach(): Unit = { | ||
ShuffleClient.reset() | ||
} | ||
|
||
override def afterEach(): Unit = { | ||
System.gc() | ||
} | ||
|
||
test("celeborn shuffle data lost - hash") { | ||
val sparkConf = new SparkConf().setAppName("celeborn-demo").setMaster("local[2]") | ||
val sparkSession = SparkSession.builder().config(sparkConf).getOrCreate() | ||
val combineResult = combine(sparkSession) | ||
val groupbyResult = groupBy(sparkSession) | ||
val repartitionResult = repartition(sparkSession) | ||
val sqlResult = runsql(sparkSession) | ||
|
||
Thread.sleep(3000L) | ||
sparkSession.stop() | ||
|
||
val conf = updateSparkConf(sparkConf, ShuffleMode.HASH) | ||
conf.set("spark.celeborn.client.spark.fetch.throwsFetchFailure", "true") | ||
conf.set("spark.celeborn.test.client.mockShuffleLost", "true") | ||
|
||
val celebornSparkSession = SparkSession.builder() | ||
.config(conf) | ||
.getOrCreate() | ||
val celebornCombineResult = combine(celebornSparkSession) | ||
val celebornGroupbyResult = groupBy(celebornSparkSession) | ||
val celebornRepartitionResult = repartition(celebornSparkSession) | ||
val celebornSqlResult = runsql(celebornSparkSession) | ||
|
||
assert(combineResult.equals(celebornCombineResult)) | ||
assert(groupbyResult.equals(celebornGroupbyResult)) | ||
assert(repartitionResult.equals(celebornRepartitionResult)) | ||
assert(combineResult.equals(celebornCombineResult)) | ||
assert(sqlResult.equals(celebornSqlResult)) | ||
|
||
celebornSparkSession.stop() | ||
} | ||
} |