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-980] Asynchronously delete original files to fix `ReusedExc…
…hange` bug ### What changes were proposed in this pull request? The `ReusedExchange` operator has the potential to generate different types of fetch requests, including both non-range and range requests. Currently, an issue arises due to the synchronous deletion of the original file by the Celeborn worker upon completion of sorting. This issue leads to the failure of non-range requests following a range request for the same partition. the snippets to reproduce this bug ```scala val sparkConf = new SparkConf().setAppName("celeborn-test").setMaster("local[2]") .set("spark.shuffle.manager", "org.apache.spark.shuffle.celeborn.SparkShuffleManager") .set(s"spark.${CelebornConf.MASTER_ENDPOINTS.key}", masterInfo._1.rpcEnv.address.toString) .set("spark.sql.autoBroadcastJoinThreshold", "-1") .set("spark.sql.adaptive.skewJoin.skewedPartitionThresholdInBytes", "100") .set("spark.sql.adaptive.advisoryPartitionSizeInBytes", "100") val spark = SparkSession.builder() .config(sparkConf) .getOrCreate() spark.range(0, 1000, 1, 10) .selectExpr("id as k1", "id as v1") .createOrReplaceTempView("ta") spark.range(0, 1000, 1, 10) .selectExpr("id % 1 as k21", "id % 1 as k22", "id as v2") .createOrReplaceTempView("tb") spark.range(140) .select( col("id").cast("long").as("k3"), concat(col("id").cast("string"), lit("a")).as("v3")) .createOrReplaceTempView("tc") spark.sql( """ |SELECT * |FROM ta |LEFT JOIN tb ON ta.k1 = tb.k21 |LEFT JOIN tc ON tb.k22 = tc.k3 |""".stripMargin) .createOrReplaceTempView("v1") spark.sql( """ |SELECT * FROM v1 WHERE v3 IS NOT NULL |UNION |SELECT * FROM v1 |""".stripMargin) .collect() ``` This PR proposes a solution to address this problem. It introduces an asynchronous thread for the removal of the original file. Once the sorted file is generated for a given partition, this modification ensures that both non-range and range fetch requests will be able to and only fetch the sorted file once it is generated for a given partition. this activity diagram of `openStream` ![openStream](https://github.com/apache/incubator-celeborn/assets/8537877/633cc5b8-e673-45a0-860e-e1f7e50c8965) ### Does this PR introduce _any_ user-facing change? No, only bug fix ### How was this patch tested? UT Closes apache#1932 from cfmcgrady/fix-partition-sort-bug-v4. Authored-by: Fu Chen <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]>
- Loading branch information
1 parent
a734b8c
commit c4135dc
Showing
21 changed files
with
909 additions
and
179 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
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
Oops, something went wrong.