Handle stale fetch streams after worker restart#3632
Closed
mzhou-oai wants to merge 10 commits intoapache:mainfrom
Closed
Handle stale fetch streams after worker restart#3632mzhou-oai wants to merge 10 commits intoapache:mainfrom
mzhou-oai wants to merge 10 commits intoapache:mainfrom
Conversation
(cherry picked from commit 8664706461c398ab48b541075a7ee11e2717a155)
eolivelli
suggested changes
Mar 17, 2026
| Throwable current = throwable; | ||
| while (current != null) { | ||
| String message = current.getMessage(); | ||
| if (message != null && message.contains("is not registered with worker")) { |
Contributor
There was a problem hiding this comment.
This check is too fragile, we need a better way.
Can we add some error code ?
Author
There was a problem hiding this comment.
ok, just did an attempt, ChunkFetchFailureException doesn't carry an error code ,and it's hard to wire in RPC. see the commit history for the attempts.
Author
There was a problem hiding this comment.
@eolivelli Please let me know which revision is preferred
Author
Yes, it's verified e2e. let me update the PR body about that. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem Statement
A worker restart can leave an in-flight reducer holding a stale
streamIdeven though the worker comes back on the same stable hostname and still has the shuffle data on disk. In that case the worker correctly reports:Stream <id> is not registered with worker. This can happen if the worker was restart recently.That is a restart-specific condition, not necessarily a hard worker failure. Live stream registrations are process-local and are not reconstructed by
recoverPath, so the oldstreamIdcannot be used after the worker process comes back.Before this change,
CelebornInputStreamtreated that response like a generic fetch failure. It excluded the worker, consumed normal retry budget and backoff, and entered the usual peer-failover or retry path instead of reopening the stream on the same worker. As a result, a Celeborn worker restart can strand active Spark tasks in Celeborn fetch retry loops even when the worker is already back and the shuffle data is still available.Proposal
This change makes stale-stream handling explicit in the client retry path:
ChunkFetchFailureerror stringChunkFetchFailureExceptionand treat it as the structured signal for same-worker reopenPartitionLocationwithpbStreamHandler = nullso the client issues a freshOPEN_STREAMValidation
mvn -pl client -am -DskipTests compilemvn -pl common -am -Dtest=ExceptionUtilsSuiteJ,TransportResponseHandlerSuiteJ test