Suppose that P1, P2, ..., P10 are in one group. The group will use bully algorithm to select new coordinator. P10 was coordinator and just crashed. If P3 find that P10 has been crashed. What P3 will do? If during the election time, no any other process will crash, how many messages will be send for select a new coordinator. Why bully algorithm want to select the process with highest number as a coordinator?
If P3 finds that P10 has crashed, it will send an election message to processes with higher ID(P4 to P9) since it is not the process with highest ID. If it does not receive an answer, it becomes the coordinator and sends a victory message to all other processes.
If no other process crashes, P3 will send 6 messages to process P4 to P9, similarly P4 will send 5 messages, P5 will send 4 messages, P6 will send 3 messages, P7 will send 2 messages and P8 will send 1 message. That is a total of 21 messages.
Bully algorithm selects the process with highest ID as coordinator so that every other process is aware of the election and the system is synchronous.
Get Answers For Free
Most questions answered within 1 hours.