4 ms·
If I've understood the presentation correctly, Raft is a master-slave protocol that determines how to choose a master. Considering it basically relies on rando
by Illniyar 12y ago
If I've understood the presentation correctly, Raft is a master-slave protocol that determines how to choose a master.
Considering it basically relies on random chance (I.E. who receives the message first) to elect a master, has basically no real way of resolving a conflict in election (I.E. if two nodes receive the same amount of votes, we do a re-election ad infinitum) and does not address the situation of two nodes having conflicting sets of data (for instance from network partition).
Considering all that, this protocol doesn't seem very interesting (from a use-case point of view).
- stonith 12y agoFor the split vote see https://github.com/goraft/raft/issues/13 https://github.com/goraft/raft/issues/13 The conflicting data under partition is covered I think - the set that doesn't meet quorum won't accept writes and will see it has a lower election term than the other partition when it re-joins. EDIT: From a use vase point of view, it simplifies the construction of CP systems. This has directly led to etcd and consul, which would be many times more complex had their authors had to implement paxos. Both etcd and consul are still young software, but if you take a look at the 'Call me Maybe' series of blog posts it's pretty apparent that there's a massive deficiency in current systems handling of network partitions. http://aphyr.com/posts/281-call-me-maybe-carly-rae-jepsen-and-the-perils-of-network-partitions http://aphyr.com/posts/281-call-me-maybe-carly-rae-jepsen-an...
- deathanatos 12y ago> and does not address the situation of two nodes having conflicting sets of data (for instance from network partition). I believe it does address this. Each log entry is either committed or not; an entry can only be committed if it has been replicated to a majority of nodes. Any node that lacks a committed entry cannot be elected master because of the election rules: a node will not vote for another node less complete than itself. Since a committed entry has been replicated to a majority, a node lacking that entry cannot receive a majority of the votes. (Thus the committed log entries will always be the same on all nodes (though some may be behind, and may only have a subset), which is the purpose of the protocol.) > Considering it basically relies on random chance (I.E. who receives the message first) to elect a master, has basically no real way of resolving a conflict in election This is mostly true. The PDF slides I link to below recommend that the election timeout be much greater than the broadcast time, the idea being that things should work out in the long run. Highly recommend the PDF slides here, as they explain it better than I can: https://ramcloud.stanford.edu/~ongaro/userstudy/ https://ramcloud.stanford.edu/~ongaro/userstudy/ — there's also a YouTube talk here: https://www.youtube.com/watch?v=YbZ3zDzDnrw https://www.youtube.com/watch?v=YbZ3zDzDnrw > Considering all that, this protocol doesn't seem very interesting (from a use-case point of view). I'd love to hear of alternatives.
- thrownaway2424 12y agoIt does seem like the election timeout needs to be way longer than 150ms. The (default) TCP min_rto parameter on Linux is 200ms. A single lost packet could cause an election with the timeout from the paper. You'd either need to use longer timeouts or reduce min_rto to something sensible. And of course the equation changes for geographically distant servers.
- Illniyar 12y ago> I believe it does address this. Each log entry is either committed or not; an entry can only be committed if it has been replicated to a majority of nodes. Any node that lacks a committed entry cannot be elected master because of the election rules: a node will not vote for another node less complete than itself. Since a committed entry has been replicated to a majority, a node lacking that entry cannot receive a majority of the votes. (Thus the committed log entries will always be the same on all nodes (though some may be behind, and may only have a subset), which is the purpose of the protocol.) What happens if (for instance) a 4 node cluster splits into 2 node clusters (I.E. a network fault between two data centers)- does each cluster choose a leader? how are is "majority" calculated? is the raft protocol unable to handle half of it's nodes being taken down? What happens if two clusters break off, both choose a leader (if it's possible), both gets new writes and then both clusters come back together? > I'd love to hear of alternatives. I no of no protocols per se, but for implementations of a master-slave protocol, there's mongo's replica-set algorithm (one notable change is that each node can have a priority). There are also master-master implementations (such as cassandra's) that require no election, and serve IMO more interesting use-cases.
- Muzzaf 12y ago> What happens if (for instance) a 4 node cluster splits into 2 node clusters (I.E. a network fault between two data centers)- does each cluster choose a leader? A Raft cluster must have an odd number of nodes. > how are is "majority" calculated? ceil(nodes/2). > is the raft protocol unable to handle half of it's nodes being taken down? What happens if two clusters break off, both choose a leader (if it's possible), both gets new writes and then both clusters come back together? They cannot each choose a leader, see above.
- sagichmal 12y ago> If I've understood the presentation correctly, Raft is a > master-slave protocol that determines how to choose a > master. You haven't understood the presentation correctly.
- erikb 12y agoYou really need to give it a review. Maybe you've seen an earlier draft than me, but for me all of what you say is addressed.