Store heartbeat messages in a independent vector
Signed-off-by: Little-Wallace [email protected]
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.
I think you can do the optimization in application. Application can detect if the ready only contains messages and advance quickly.
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?
...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.