You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The existing request-response style API offers limited parallelism and pipelining capabilities and does not allow for dynamic adjustment of request sizes.
By introducing a Stream as an argument to RaftNetwork::append_entries(), we can empower the method to replicate log entries in a more flexible and potentially optimized way.
Accordingly, the storage layer should also expose a stream-based API. We propose adding RaftLogReader::try_get_log_entries() -> impl Stream<Item=Entry>, which will enable the streaming of log entries as needed.
RaftNetwork::entries() now takes a stream of log entries for transmission and returns a stream of replication responses. Should a replication attempt result in an Err, such as the absence of prev on the remote peer or the detection of a higher term vote, the caller should immediately discard the stream.
Stream-based Replication of Log Entries
Rationale
The existing request-response style API offers limited parallelism and pipelining capabilities and does not allow for dynamic adjustment of request sizes.
By introducing a
Stream
as an argument toRaftNetwork::append_entries()
, we can empower the method to replicate log entries in a more flexible and potentially optimized way.Accordingly, the storage layer should also expose a stream-based API. We propose adding
RaftLogReader::try_get_log_entries() -> impl Stream<Item=Entry>
, which will enable the streaming of log entries as needed.Proposed new API:
RaftNetwork::entries()
now takes a stream of log entries for transmission and returns a stream of replication responses. Should a replication attempt result in anErr
, such as the absence ofprev
on the remote peer or the detection of a higher term vote, the caller should immediately discard the stream.TODO:
RaftLogStorage
toRaftLogReader::read_vote()
#1077The text was updated successfully, but these errors were encountered: