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

Store heartbeat messages in a independent vector #395

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Little-Wallace
Copy link

Signed-off-by: Little-Wallace bupt2013211450@gmail.com

Store heartbeat messages in a independent vector so that we do not need to create a Ready struct for raft-group even if there is no entries or propose data in state-machine. And we can send these message at once because there is no Ready need to be persisted.

@Little-Wallace Little-Wallace added Optimization Performance related optimizations. Do Not Merge A blocked PR. Please do not merge it. labels Aug 30, 2020
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
@BusyJay
Copy link
Member

BusyJay commented Aug 31, 2020

I think you can do the optimization in application. Application can detect if the ready only contains messages and advance quickly.

@maxsitu
Copy link

maxsitu commented Dec 20, 2020

I think you can do the optimization in application. Application can detect if the ready only contains messages and advance quickly.

Isn't this idea actually exposing the internal logic to the application level? Shouldn't it be better off hidden inside the library?

@BusyJay
Copy link
Member

BusyJay commented Dec 21, 2020

...internal logic...

Exposing a field to caller instead of going through the ready protocol is exact what you call "exposing internal logic". 😆

The library is about raft algorithm, we try to make it as clear and simple as possible, which is the key of correctness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do Not Merge A blocked PR. Please do not merge it. Optimization Performance related optimizations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants