[fluss-server] Fix replicasOnOffline deadlock with enhanced diagnostics#3012
Open
platinumhamburg wants to merge 1 commit intoapache:mainfrom
Open
[fluss-server] Fix replicasOnOffline deadlock with enhanced diagnostics#3012platinumhamburg wants to merge 1 commit intoapache:mainfrom
platinumhamburg wants to merge 1 commit intoapache:mainfrom
Conversation
d109537 to
720122f
Compare
Only fatal errors (STORAGE_EXCEPTION, LOG_STORAGE_EXCEPTION, KV_STORAGE_EXCEPTION, UNKNOWN_SERVER_ERROR) mark replicas offline. All other NotifyLeaderAndIsr errors are transient and do not affect leader election eligibility. Also fixes ReplicaManager to return LeaderNotAvailableException instead of StorageException when leaderId is null or negative.
720122f to
2af4779
Compare
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.
Root cause: ReplicaManager.addFetcherForReplicas() misclassified "no leader" (leaderId=null) as a STORAGE_EXCEPTION, which triggered permanent offline marking via replicasOnOffline. Once a replica was marked offline, it was excluded from liveReplicas during election, causing the bucket to remain leaderless indefinitely.
Fix: Replace the error branch with a simple guard (leaderId != null && leaderId >= 0) that skips fetcher setup for replicas without a valid leader, allowing them to recover naturally on the next LeaderAndIsr notification.
Additional improvements:
(The sections below can be removed for hotfixes or typos)
-->
Purpose
Linked issue: close #3011 3011
Brief change log
Tests
API and Format
Documentation