-1

I am currently learning about the bully algorithm for agreement in distributed systems. I understand how the election works but i am a bit confused on what happens for example if process 4 fails and process 2 started an election and process 3 wins and after process 3 announces that it is the coordinator what happens if process 4 wakes up? does process 3 continue being the coordinator or will there be another election and if so who starts the election? Thank you in advance and sorry if i have lost anyone with this long question

user3659384
  • 37
  • 2
  • 8

1 Answers1

3

Once process 4 wakes up, it will know that it has the highest identifier and will elect itself as the coordinator of the group. Usually the implementation contains a view of the group (i.e. the id of each process in the group). This will give to process 4 the permission to request a new election or it can simply announce itself as the leader of the group by sending a coordinator message to the rest of the processes (which obviously will have lower identifiers based on the assumption made before). Hence, the bully algorithm name.

Andrei
  • 7,509
  • 7
  • 32
  • 63
  • Thank you, Andrei. I had the exact same question and glad to find your answer here. However, I'm still a bit confused. Say process 4 wakes up **while** process 3 is still in the process of announcing Victory to every other node. Suppose process 3 has successfully announced Victory to node 2, but **not yet** to node 1. Now process 4 immediately announces Victory to node 1, then node 2. After that, process 3's announcement arrives at node 1. From node 1's perspective, it received "node 4 win" first, then "node 3 win". Node 2 is the reverse. Doesn't this cause node 1 & 2 to hold different views? – Weipeng Apr 21 '22 at 05:35