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

Evaluate the impact of async, out of order replication #11

Open
adsharma opened this issue Mar 15, 2021 · 0 comments
Open

Evaluate the impact of async, out of order replication #11

adsharma opened this issue Mar 15, 2021 · 0 comments

Comments

@adsharma
Copy link
Owner

https://github.com/adsharma/raft/blob/master/raft/states/leader.py#L168-L180

This loop can send out new log entries before it has received acks from followers. This is not validated for correctness by TLA+ implementation of the raft protocol. See on_response_received() in the same file where acks are processed and leader commitIndex is advanced.

It's possible that multiple followers ack log entry at index 9, but do not agree on log entry at index 7.

The current implementation uses uuids to assign a unique ID to each AppendEntriesRPC. When it receives an ack, it looks up a cache of the uuid -> AppendEntriesRPC to discover which particular log entries were acked. It then advances matchIndex here:

https://github.com/adsharma/raft/blob/master/raft/states/leader.py#L102-L105

It's not clear that this is safe. It's possible that some previous log entries haven't been matched yet if there is packet loss.

We also need to think about all the failure cases, network partition, leader rejoining etc.

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

No branches or pull requests

1 participant