Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move IO to separate thread #724

Open
4 of 9 tasks
drmingdrmer opened this issue Mar 20, 2023 · 1 comment
Open
4 of 9 tasks

Move IO to separate thread #724

drmingdrmer opened this issue Mar 20, 2023 · 1 comment
Assignees

Comments

@drmingdrmer
Copy link
Member

drmingdrmer commented Mar 20, 2023

IO operations such as RaftStorage::append_to_log() and RaftStorage::apply_to_state_machine() are currently executed within the tokio-task that runs RaftCore, causing every IO operation blocks the entire system.

To avoid this issue, IO operations should be performed in a separate tokio-task, allowing RaftCore to receive IO completion events via the event channel. This approach will enable RaftCore to handle other requests while IO operation is in progress.


  • To prevent reference sharing, extract the entries from input entries buffer instead of directly referencing them. The buffer used for input entries can not be shared between RaftCore and the IO-worker.
  • IO and network operations are queued in Engine.output.commands. Send these commands to the io-worker thread.
@drmingdrmer drmingdrmer self-assigned this Mar 20, 2023
@github-actions
Copy link

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant