-
Notifications
You must be signed in to change notification settings - Fork 28k
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-33916][CORE] Fix fallback storage offset and improve compression codec test coverage #30934
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ class FallbackStorageSuite extends SparkFunSuite with LocalSparkContext { | |
test("fallback storage APIs - copy/exists") { | ||
val conf = new SparkConf(false) | ||
.set("spark.app.id", "testId") | ||
.set(SHUFFLE_COMPRESS, false) | ||
.set(STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED, true) | ||
.set(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH, | ||
Files.createTempDirectory("tmp").toFile.getAbsolutePath + "/") | ||
|
@@ -227,43 +228,45 @@ class FallbackStorageSuite extends SparkFunSuite with LocalSparkContext { | |
} | ||
} | ||
|
||
test("Newly added executors should access old data from remote storage") { | ||
sc = new SparkContext(getSparkConf(2, 0)) | ||
withSpark(sc) { sc => | ||
TestUtils.waitUntilExecutorsUp(sc, 2, 60000) | ||
val rdd1 = sc.parallelize(1 to 10, 2) | ||
val rdd2 = rdd1.map(x => (x % 2, 1)) | ||
val rdd3 = rdd2.reduceByKey(_ + _) | ||
assert(rdd3.collect() === Array((0, 5), (1, 5))) | ||
Seq("lz4", "snappy", "zstd").foreach { codec => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The doc of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I'll add that, @MaxGekk . |
||
test(s"$codec - Newly added executors should access old data from remote storage") { | ||
sc = new SparkContext(getSparkConf(2, 0).set(IO_COMPRESSION_CODEC, codec)) | ||
withSpark(sc) { sc => | ||
TestUtils.waitUntilExecutorsUp(sc, 2, 60000) | ||
val rdd1 = sc.parallelize(1 to 10, 2) | ||
val rdd2 = rdd1.map(x => (x % 2, 1)) | ||
val rdd3 = rdd2.reduceByKey(_ + _) | ||
assert(rdd3.collect() === Array((0, 5), (1, 5))) | ||
|
||
// Decommission all | ||
val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] | ||
sc.getExecutorIds().foreach { | ||
sched.decommissionExecutor(_, ExecutorDecommissionInfo(""), false) | ||
} | ||
|
||
// Decommission all | ||
val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] | ||
sc.getExecutorIds().foreach { | ||
sched.decommissionExecutor(_, ExecutorDecommissionInfo(""), false) | ||
} | ||
// Make it sure that fallback storage are ready | ||
val fallbackStorage = new FallbackStorage(sc.getConf) | ||
eventually(timeout(10.seconds), interval(1.seconds)) { | ||
Seq( | ||
"shuffle_0_0_0.index", "shuffle_0_0_0.data", | ||
"shuffle_0_1_0.index", "shuffle_0_1_0.data").foreach { file => | ||
assert(fallbackStorage.exists(0, file)) | ||
} | ||
} | ||
|
||
// Make it sure that fallback storage are ready | ||
val fallbackStorage = new FallbackStorage(sc.getConf) | ||
eventually(timeout(10.seconds), interval(1.seconds)) { | ||
Seq( | ||
"shuffle_0_0_0.index", "shuffle_0_0_0.data", | ||
"shuffle_0_1_0.index", "shuffle_0_1_0.data").foreach { file => | ||
assert(fallbackStorage.exists(0, file)) | ||
// Since the data is safe, force to shrink down to zero executor | ||
sc.getExecutorIds().foreach { id => | ||
sched.killExecutor(id) | ||
} | ||
eventually(timeout(20.seconds), interval(1.seconds)) { | ||
assert(sc.getExecutorIds().isEmpty) | ||
} | ||
} | ||
|
||
// Since the data is safe, force to shrink down to zero executor | ||
sc.getExecutorIds().foreach { id => | ||
sched.killExecutor(id) | ||
} | ||
eventually(timeout(20.seconds), interval(1.seconds)) { | ||
assert(sc.getExecutorIds().isEmpty) | ||
// Dynamic allocation will start new executors | ||
assert(rdd3.collect() === Array((0, 5), (1, 5))) | ||
assert(rdd3.sortByKey().count() == 2) | ||
assert(sc.getExecutorIds().nonEmpty) | ||
} | ||
|
||
// Dynamic allocation will start new executors | ||
assert(rdd3.collect() === Array((0, 5), (1, 5))) | ||
assert(rdd3.sortByKey().count() == 2) | ||
assert(sc.getExecutorIds().nonEmpty) | ||
} | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this bug, I am wondering if we want to refactor
IndexShuffleBlockResolver.read
such that we can reuse it here as well ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, for Apache Spark 3.2.0, @mridulm ? Currently, this PR is aiming to provide this fix for Apache Spark 3.1.0 RC before next Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, thanks @dongjoon-hyun !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @mridulm !