PHOENIX-7854 Use Abortable interface to trigger RS aborts#2474
Open
tkhurana wants to merge 3 commits into
Open
PHOENIX-7854 Use Abortable interface to trigger RS aborts#2474tkhurana wants to merge 3 commits into
tkhurana wants to merge 3 commits into
Conversation
Use @CoreCoprocessor + HasRegionServerServices to obtain an Abortable (RegionServerServices) in IndexRegionObserver and PhoenixRegionServerEndpoint, and thread it into ReplicationLogGroup so that abort() triggers a real RS shutdown instead of only throwing a RuntimeException.
…r lifecycle The event handler thread no longer calls abort() or close() on itself. On fatal errors it sets a fatalException field, fails pending sync futures, and keeps consuming events (so the ring buffer doesn't block producers). The producer thread that receives the failed future calls abort(), which closes resources and invokes Abortable on its own thread. This eliminates the close(boolean graceful) split — a single close() always drains with a timeout and falls back to halt. When the handler has a fatal exception the drain completes instantly. The onShutdown callback derives graceful vs non-graceful from fatalException == null, removing the gracefulShutdownEventHandlerFlag field entirely.
kadirozde
reviewed
May 14, 2026
| if (env instanceof RegionServerCoprocessorEnvironment) { | ||
| this.serverName = ((RegionServerCoprocessorEnvironment) env).getServerName(); | ||
| } | ||
| if (env instanceof HasRegionServerServices) { |
Contributor
There was a problem hiding this comment.
Is this check necessary? Are there cases where env is not an instance of RegionServerCoprocessorEnvironment here or is this just defensive coding? Can we add a comment here to clarify?
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.
Summary
producer thread (RPC handler) that receives the failed future initiates the abort
Test plan
ReplicationLogGroupTestupdated to expectIOException/PhoenixWALSyncTimeoutExceptioninstead ofRuntimeException