You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by re...@apache.org on 2024/07/16 01:08:51 UTC
(celeborn) branch branch-0.4 updated: [CELEBORN-1507] Prevent invalid Filegroups from being used
This is an automated email from the ASF dual-hosted git repository.
rexxiong pushed a commit to branch branch-0.4
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/branch-0.4 by this push:
new c13f68853 [CELEBORN-1507] Prevent invalid Filegroups from being used
c13f68853 is described below
commit c13f6885364030535e34c5dc1935850674deb199
Author: zhangzhao.08 <zh...@bytedance.com>
AuthorDate: Tue Jul 16 09:07:54 2024 +0800
[CELEBORN-1507] Prevent invalid Filegroups from being used
### What changes were proposed in this pull request?
Prevent invalid Filegroups from being used.
### Why are the changes needed?
#2531 introduced a new feature regarding Filegroups. For multiple tasks belonging to the same shuffleKey, only one of them will actively fetch, and the others will use the cached results in memory. If the Task that actively fetches the Filegroups is killed for some reason (such as another attempt succeeded), it will cause other tasks to obtain invalid Filegroups, eventually leading to stage retry.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
Internal test.
Closes #2625 from zhaostu4/invalid_cache.
Lead-authored-by: zhangzhao.08 <zh...@bytedance.com>
Co-authored-by: ZHAO ZHAO <44...@users.noreply.github.com>
Signed-off-by: Shuang <lv...@alibaba-inc.com>
(cherry picked from commit 82a3abf10e9a9c25307b3b2eb2859d5893cd2115)
Signed-off-by: Shuang <lv...@alibaba-inc.com>
---
.../java/org/apache/celeborn/client/ShuffleClientImpl.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java b/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
index 1366a3332..d8eb469bd 100644
--- a/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
+++ b/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
@@ -1624,7 +1624,15 @@ public class ShuffleClientImpl extends ShuffleClient {
protected ReduceFileGroups updateFileGroup(int shuffleId, int partitionId)
throws CelebornIOException {
Tuple2<ReduceFileGroups, String> fileGroupTuple =
- reduceFileGroupsMap.computeIfAbsent(shuffleId, (id) -> loadFileGroupInternal(shuffleId));
+ reduceFileGroupsMap.compute(
+ shuffleId,
+ (id, existsTuple) -> {
+ if (existsTuple == null || existsTuple._1 == null) {
+ return loadFileGroupInternal(shuffleId);
+ } else {
+ return existsTuple;
+ }
+ });
if (fileGroupTuple._1 == null) {
throw new CelebornIOException(
loadFileGroupException(shuffleId, partitionId, (fileGroupTuple._2)));