In the past I didn't enjoy system design, but after trying it with Jordan my life changed and I started enjoying it. Thanks, Jordan for making all these videos!
@jporritt5 ай бұрын
I appreciate this length of video. Really convenient for getting complex topics.
@sahilkalamkar53329 ай бұрын
At 7:52, so essentially if there is a node which has more up to date logs then the leader being considered for election, those extra writes will be ignored if someone else is chosen as leader?
@jordanhasnolife51639 ай бұрын
Yep, unless that write is in a majority of the nodes, in which case it isn't possible for there to be a new leader without the write
@sahilkalamkar53329 ай бұрын
@@jordanhasnolife5163 so if the leader being elected receives a no from one of the nodes, but receives a yes from other nodes, will the election move ahead?
@jordanhasnolife51638 ай бұрын
@@sahilkalamkar5332 As long as there are more "yes" votes than "no" votes, then the election should move along yeah
@radosawmul89638 ай бұрын
@@jordanhasnolife5163 Hmm but what happens from the perspective of the user who actually inserted those rights? :O He has probably been presented with some "write successful" screen before and now his data is lost? Or is it like he haven't got confirmation that his write was successful, because quorum didn't agree on it yet. 👀
@jordanhasnolife51638 ай бұрын
@@radosawmul8963 Yep you got it - you only get confirmation of your write once it gets to a quorum of nodes. If it's in a quorum of nodes, then an election to a leader without the write could not have passed, since that quorum will all vote no.
@msebrahim-0076 ай бұрын
1 - (4:05) In general, how can a follower be behind the current term number? Does this imply the follow node went down and came back up at a time when there was a new term? 2 - (4:35) How is it possible that a follower is in a term number that is greater than or equal to the term number that is being proposed? Once again i'm thinking that this follower perhaps went down and is massively behind when it comes back online? As a follow up to this question, if this implies that there is already a leader for term 29, shouldn't the candidate stop its proposal altogether since there is already a leader for term 29?
@jordanhasnolife51636 ай бұрын
1) Since raft only requires a majority of nodes to proceed with an operation, a follower that is offline and then comes back online can be behind. So yeah as you implied it comes back online during the new term. 2) Any node, including an outdated follower can propose a new leader election. In this case, one of the up to date followers basically needs to veto and start its own leader election. Imagine we have 5 nodes, and it is term 29. The leader goes down, and a follower proposes and creates term 30 becoming the new leader. That new leader then goes down, and the old leader comes back up. The old leader notices there is no current leader, and proposes an election on term 29, only to be veto'd by all of the other followers who were on term 30. The candidate will stop its proposal once a majority of nodes either say "no" or "there is already a leader" and respond to it.
@bokistotel5 ай бұрын
@6:48 "If an older leader proposes a write with a lower epoch number than a current token we KNOW that it is an old leader". My question is why do we know for certain that is was an old Leader? Couldn't it be an old Follower that updated its epoch number? Or are we assuming that this is a single leader replication and the one who proposes a write by definition must be/was a leader ?
@jordanhasnolife51634 ай бұрын
You're correct on the 2nd thing you said
@yrfvnihfcvhjikfjn Жыл бұрын
This dude is casually bragging about leaving his house. Smh not even a real shut in
@jordanhasnolife5163 Жыл бұрын
Lol imagine going outside
@reddy50955 ай бұрын
Suppose we have 5 nodes A B C D E, A is the current leader and it went down, B proposes and gets a yes from C and does not get a reply from other nodes and so B considers itself leader, At the same time D also proposes and gets a yes from E and does not get a reply from other nodes, Since both B and D got majority votes both will think they are the leader right?
@jordanhasnolife51635 ай бұрын
Those aren't majorities. The "majority" size always applies to the original size of the cluster, which is 3 in this case
@sebuszqo32397 ай бұрын
hi, so what in case when we have 3 nodes and leader goes down? then election is 50:50? One node will say I am a candidate and if second one say "yes you are" everything is fine but what if the second node will say "no"?
@jordanhasnolife51637 ай бұрын
Yep! It's only fault tolerant to an extent, it can never be perfectly fault tolerant!
@zylophone777Ай бұрын
watching this today makes sense
@jordanhasnolife5163Ай бұрын
I'm afraid America's consensus system is cooked though
@PrabhuMarappan77 ай бұрын
At 2:51, you say that each node complains after random unit of time. But is that because each node has a different time to wait till the next heartbeat or is there? Or both are different?
@jordanhasnolife51637 ай бұрын
Yeah exactly, each node gets configured with a slightly different time to start an election after thinking the leader is down
@dwivedys5 ай бұрын
Pretty, pretty tough! Consensus is as tough in tech as it is in real life I guess….
@rahullingala731110 ай бұрын
How do the nodes know how much of it's log it should communicate with the other nodes? Won't the logs be too huge?
@jordanhasnolife516310 ай бұрын
They go backwards from the start one entry at a time to catch them up
@msebrahim-0076 ай бұрын
@@jordanhasnolife5163 Having trouble understanding "go backwards from the start". If we assume a leader has the following writes in its log 89 88 87 86 And a followers log is on write 86, does this mean the leader starts at write 87 and goes to 89? Then the leader will send 87-89 to the follower?
@jordanhasnolife51636 ай бұрын
@@msebrahim-007 It means they try to send 89, and the follower says wait I actually also need 88 and 87.