Q. Present an algorithm for reconstructing a logical ring after a process in the ring fails?
Answer: Typically distributed systems utilize a coordinator process that performs functions needed by other processes in the system. This would comprise enforcing mutual exclusion and-in this case of a ring -replacing a lost token.
A scheme alike to the ring algorithm presented that can be used. The algorithm is as follows:
The ring algorithm presumes that the links are unidirectional and that processes send their messages to the neighbour on their right. The major data structure utilized by the algorithm is the active list a list that contains the priority numbers of all active processes in the system when the algorithm ends each one process maintains its own active list.
a. If process Pi notices a coordinator failure it creates a new active list that is initially empty. It then sends a message elect (i) to its right neighbour and adds the number i to its active list.
b. If Pi obtains a message elect (j) from the process on the left it should respond in one of three ways
1. If this is the first elect message it has seen or else sent Pi creates a new active list with the numbers i and j. It subsequently sends the message elect (i) followed by the message elect(j).
2. If i _= j that is the message received doesn't contain Pi 's number afterwards Pi adds j to its active list and forwards the message to its right neighbour.
3. If i = j, that is Pi accepts the message elect (i) then the active list for Pi now enclose the numbers of all the active processes in the system. Process Pi can currently determine the largest number in the active list to identify the new coordinator process.