But thats ok were safe even if there are multiple

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s to elect a leader, as a “hint” – something that is usually true, but might be false, and doesn’t lead to incorrect behavior when it is false. For this, we can use any convenient algorithm to elect a leader. Let’s assume that all nodes know about each other – there’s a static list of nodes in the system. Then we can arbitrarily state that the lowest numbered node that is alive is the leader – so each node only needs to check periodically if a lower numbered node is alive. If so, they can’t be the leader. If not, they are the leader. But we can engineer the system to almost always have one proposer: out of k nodes, pick lowest node that is up; if I’ve seen a recent message from a node with a lower #, stop proposing Then various things you might do: If you think you are the lowest #, broadcast a ping to everyone to let everyone know you are up If hear a proposal from someone, when you’ve recently heard a proposal from someone with a lower #, ignore the higher # (they are probably just misinformed) Now this won’t always work! But that’s ok – we’re safe even if there are multiple leaders. 3) use of stable storage proposer needs to keep track of last proposal # used (since can’t reissue a proposal #) acceptor needs to keep track of response to prepare request (to ensure don’t accept any lower #’ed proposals) acceptor needs to keep track of response to accept request (what value have I accepted) learner needs to store chosen value => 3 + k disk writes use flash! And/or when node fails, don’t let it recover! Then we only need a disk write for the learner, and tha...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online