Let L be the list of co-ordinators forming the ARC ring. Let N be
the coordinator whose monitor process has detected the failure.
Following are the RPC services:
void *broadcast_leave(int* id);
On the client side :
The client is that coordinator
which has been informed by the leave process
to leave the ARC ring.
On the server side
Each of the coordinator
Q on receiving this function call from node N do the
following:
1) In the node array, mark the entry corresponding to "id" as -2,
that indicates that the co-ordinator whose node-id was id has left.
2) If the node that left is the last one in the ring, then the
co-ordinator Q finds whether Q is the last node, by looking at the
array L.
3) If Q is the last node, then set the value of the flag in Q
globLstMe = true.
4) All the user process that have submitted their computation with
the co-ordinator must be informed of this node failure. For this the
id of the coordinator that is leaving is send to the user messsage
queue.
5) If the monitor R present at the same machine as Q was
monitoring node id then R must now start monitoring that node which
the monitor present at the site of coordinator id was monitoring.
For this, the list L is searched to find the next co-ordinator
in the ARC ring and the monitor R is given its id, by sending
the info in the timer message queue and sending a signal to R.
6) Monitor R starts monitoring the new node.
void leave_system():
This is a local RPC call from the leave process
to the local coordinator.
On the client side :
The client is the leave
process that makes a RPC call to this function.
On the server side :
The call is received
by the coordinator present on the same node as the
client leave process.
Create a client handle
and call the RPC function broadcast_leave(int* globMyId) on all
the co-ordinators to tell them that it is leaving. ( Note that "globMyId"
is the id of the coordinator that is making the RPC call).