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
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.