-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-34541][CORE] Fixed an issue where data could not be cleaned up when unregisterShuffle. #31648
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-34541][CORE] Fixed an issue where data could not be cleaned up when unregisterShuffle. #31648
Changes from all commits
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 |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ class StringExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { | |
| test("concat") { | ||
| def testConcat(inputs: String*): Unit = { | ||
| val expected = if (inputs.contains(null)) null else inputs.mkString | ||
| checkEvaluation(Concat(inputs.map(Literal.create(_, StringType))), expected, EmptyRow) | ||
| checkEvaluation(Concat(inputs.map(Literal.create(_, StringType))), expected) | ||
|
Contributor
Author
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. For reviewer : clean up unused code for code simplifications.
Contributor
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. Is this test change related to the code change? |
||
| } | ||
|
|
||
| testConcat() | ||
|
|
@@ -50,7 +50,7 @@ class StringExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { | |
| test("SPARK-22498: Concat should not generate codes beyond 64KB") { | ||
| val N = 5000 | ||
| val strs = (1 to N).map(x => s"s$x") | ||
| checkEvaluation(Concat(strs.map(Literal.create(_, StringType))), strs.mkString, EmptyRow) | ||
| checkEvaluation(Concat(strs.map(Literal.create(_, StringType))), strs.mkString) | ||
| } | ||
|
|
||
| test("SPARK-22771 Check Concat.checkInputDataTypes results") { | ||
|
|
@@ -73,7 +73,7 @@ class StringExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { | |
| case s: String => Literal.create(s, StringType) | ||
| } | ||
| val sepExpr = Literal.create(sep, StringType) | ||
| checkEvaluation(ConcatWs(sepExpr +: inputExprs), expected, EmptyRow) | ||
| checkEvaluation(ConcatWs(sepExpr +: inputExprs), expected) | ||
| } | ||
|
|
||
| // scalastyle:off | ||
|
|
@@ -99,12 +99,12 @@ class StringExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { | |
| val sepExpr = Literal.create("#", StringType) | ||
| val strings1 = (1 to N).map(x => s"s$x") | ||
| val inputsExpr1 = strings1.map(Literal.create(_, StringType)) | ||
| checkEvaluation(ConcatWs(sepExpr +: inputsExpr1), strings1.mkString("#"), EmptyRow) | ||
| checkEvaluation(ConcatWs(sepExpr +: inputsExpr1), strings1.mkString("#")) | ||
|
|
||
| val strings2 = (1 to N).map(x => Seq(s"s$x")) | ||
| val inputsExpr2 = strings2.map(Literal.create(_, ArrayType(StringType))) | ||
| checkEvaluation( | ||
| ConcatWs(sepExpr +: inputsExpr2), strings2.map(s => s(0)).mkString("#"), EmptyRow) | ||
| ConcatWs(sepExpr +: inputsExpr2), strings2.map(s => s(0)).mkString("#")) | ||
| } | ||
|
|
||
| test("elt") { | ||
|
|
||
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.
For more convenient review:
ShuffleMapTask#runTask
val mapId = if (SparkEnv.get.conf.get(config.SHUFFLE_USE_OLD_FETCH_PROTOCOL)) { partitionId } else context.taskAttemptId()SortShuffleManager#getWriter
val mapTaskIds = taskIdMapsForShuffle.computeIfAbsent( handle.shuffleId, _ => new OpenHashSet[Long](16)) mapTaskIds.synchronized { mapTaskIds.add(context.taskAttemptId()) }SortShuffleManager#unregisterShuffle
Option(taskIdMapsForShuffle.remove(shuffleId)).foreach { mapTaskIds => mapTaskIds.iterator.foreach { mapTaskId => shuffleBlockResolver.removeDataByMap(shuffleId, mapTaskId) } }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.
@xuanyuanking do you have an opinion here? I think you wrote this piece of the code.
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.
Thanks for pinging me, I'm reviewing #31664