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

Separate Leaders and Followers into different raft workers. #674

Open
coocood opened this issue Oct 12, 2021 · 2 comments
Open

Separate Leaders and Followers into different raft workers. #674

coocood opened this issue Oct 12, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@coocood
Copy link
Collaborator

coocood commented Oct 12, 2021

Currently only a single raft worker process raft messages, the workload for leaders and followers are very different.

Leaders takes more time to handle messages, Append messages are sent before data persistence.

Followers takes less time to handle messages, AppendResponse messages are sent after data persistence.

If we separate leaders and followers, they don't need to wait for each other to finish, the latency would be lower, the resource utilization would be higher.

@coocood coocood added the enhancement New feature or request label Oct 12, 2021
@coocood
Copy link
Collaborator Author

coocood commented Oct 12, 2021

If a peer role changed after processed a raft message, we wrap the peer to a message and send it to the other worker.
If a message is sent to a worker of a different role, we forward the message to the other worker.

@coocood
Copy link
Collaborator Author

coocood commented Oct 12, 2021

@hslam

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

No branches or pull requests

1 participant