عجفت الغور

bully algorithm

Tags: algorithms, distributed systems

https://en.wikipedia.org/wiki/Bully_algorithm

If the proposer is not proposing to be a laeder, any node can claim to be a leader. For a particular node to be accepted by the cluster, the node sends its server IDs to all peers within the cluster. The peers respond with their server ID. If all responses are smaller than the node’s server ID, that node becomes leader

If a peer recieves the ID of a node and wants to be a leader, and its ID is greater than the received ID, then instead of returning its ID, it starts an election to become the leader. This prevents livelocks

Links to this note