Skip to content

RATIS-2340. Add ReadIndexAsync executor for readIndex stateMachine query#1295

Open
symious wants to merge 1 commit intoapache:masterfrom
symious:RATIS-2340
Open

RATIS-2340. Add ReadIndexAsync executor for readIndex stateMachine query#1295
symious wants to merge 1 commit intoapache:masterfrom
symious:RATIS-2340

Conversation

@symious
Copy link
Copy Markdown
Contributor

@symious symious commented Oct 1, 2025

What changes were proposed in this pull request?

Currently the query work is done by the ELG worker threads, need to separate the works so that workers can focus on their job.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2340

How was this patch tested?

Stack dump shows not using ELG worker threads.

return replyFuture
.thenCompose(readIndex -> getReadRequests().waitToAdvance(readIndex))
.thenCompose(readIndex -> queryStateMachine(request))
.thenComposeAsync(ignored -> stateMachine.query(request.getMessage()), readAsyncExecutor)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@symious , Since it is calling stateMachine.query(..), the StateMachine implementation could choose to run it with its own executor. If we use an executor here, then the stateMachine has no choice and is forced to run it with Ratis executor. So I suggest not to make this change.

@github-actions
Copy link
Copy Markdown

This PR has been marked as stale due to 60 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in ~30 days.

@github-actions github-actions bot added the stale label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants