-
Notifications
You must be signed in to change notification settings - Fork 370
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
[CELEBORN-1496] Differentiate map results with only different stageAttemptId #2609
Closed
Closed
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
45fe4ee
[CELEBORN-1496] Differentiate map results with only different stageAt…
jiang13021 e0affd7
reproduce duplicate data problem and add ut
RexXiong c0243d0
Add SparkCommonUtils.validateAttemptConfig
jiang13021 2bf9d3f
fix
jiang13021 042fefc
Update client-spark/spark-2/src/test/scala/org/apache/spark/shuffle/c…
cfmcgrady b0ac8a7
Update client-spark/spark-3/src/test/scala/org/apache/spark/shuffle/c…
cfmcgrady f547598
fix
jiang13021 7f16e8f
Revert "fix"
jiang13021 69d930f
Revert "[CELEBORN-1558] Fix the incorrect decrement of pendingWrites …
jiang13021 a341dac
trigger CI
jiang13021 e98331f
Revert "reproduce duplicate data problem and add ut"
jiang13021 53805b2
Revert "Revert "[CELEBORN-1558] Fix the incorrect decrement of pendin…
jiang13021 33e2935
fix
jiang13021 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
client-spark/common/src/main/java/org/apache/spark/shuffle/celeborn/SparkCommonUtils.java
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,53 @@ | ||
/* | ||
* 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.shuffle.celeborn; | ||
|
||
import org.apache.spark.SparkConf; | ||
import org.apache.spark.TaskContext; | ||
import org.apache.spark.scheduler.DAGScheduler; | ||
|
||
public class SparkCommonUtils { | ||
public static void validateAttemptConfig(SparkConf conf) throws IllegalArgumentException { | ||
int maxStageAttempts = | ||
conf.getInt( | ||
"spark.stage.maxConsecutiveAttempts", | ||
DAGScheduler.DEFAULT_MAX_CONSECUTIVE_STAGE_ATTEMPTS()); | ||
// In Spark 2, the parameter is referred to as MAX_TASK_FAILURES, while in Spark 3, it has been | ||
// changed to TASK_MAX_FAILURES. The default value for both is consistently set to 4. | ||
int maxTaskAttempts = conf.getInt("spark.task.maxFailures", 4); | ||
if (maxStageAttempts >= (1 << 15) || maxTaskAttempts >= (1 << 16)) { | ||
// The map attemptId is a non-negative number constructed from | ||
// both stageAttemptNumber and taskAttemptNumber. | ||
// The high 16 bits of the map attemptId are used for the stageAttemptNumber, | ||
// and the low 16 bits are used for the taskAttemptNumber. | ||
// So spark.stage.maxConsecutiveAttempts should be less than 32768 (1 << 15) | ||
// and spark.task.maxFailures should be less than 65536 (1 << 16). | ||
throw new IllegalArgumentException( | ||
"The spark.stage.maxConsecutiveAttempts should be less than 32768 (currently " | ||
+ maxStageAttempts | ||
+ ")" | ||
+ "and spark.task.maxFailures should be less than 65536 (currently " | ||
+ maxTaskAttempts | ||
+ ")."); | ||
} | ||
} | ||
|
||
public static int getEncodedAttemptNumber(TaskContext context) { | ||
return (context.stageAttemptNumber() << 16) | context.attemptNumber(); | ||
} | ||
} |
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.
Oops, something went wrong.
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.
As we discussed earlier (I cant seem to find the ref :-) ) - please do submit a PR to Apache Spark as well for this - and ensure the communities can align on this assumption.