Merged
Conversation
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
hicqu
reviewed
Mar 2, 2020
| to_send.set_index(rs.index); | ||
| to_send.set_entries(req.take_entries()); | ||
| *more_to_send = Some(to_send); | ||
| ctx.more_to_send.push(to_send); |
Contributor
There was a problem hiding this comment.
How about more_to_send: HashMap<u64, Message>? So we can send only 1 read index response to one peer.
Member
Author
There was a problem hiding this comment.
HashMap is slower than Vec, it may not be a good idea. On the other hand, the optimization assumes there is a queue in follower side, which may not be a valid case.
Contributor
|
rest LGTM. BTW could you send a PR to master? Let's think about how to fix test cases about initializing with configuration. |
Member
Author
|
I will port to master when tests issues are fixed. |
hicqu
previously approved these changes
Mar 2, 2020
gengliqi
reviewed
Mar 3, 2020
src/raft.rs
Outdated
| } | ||
|
|
||
| if send_append { | ||
| if ctx.has_reply { |
Member
There was a problem hiding this comment.
The has_reply is a bit redundant. Maybe we can change it to
Suggested change
| if ctx.has_reply { | |
| if ctx.send_append || ctx.loop_append { |
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
hicqu
approved these changes
Mar 3, 2020
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The patch is to speed up log replication when a node is way behind than leader and logs are not compacted yet.