Search code examples
javaoperating-systemdistributed-computingdistributed-system

Initiator nodes in a distributed system


I've got an assignment to find out the all possible initiator nodes for a state recording algorithm in the distributed system.

The question that has been given exactly is

"Write a program to find out the all possible initiator nodes for a state recording algorithm in a distributed system.".

I want to mentioned that we have studied Chandy - Lamport's global state recording algorithm on our course of distributed operating system. I wrote a code for Chandy - Lamport's global state recording algorithm for the another assignment.

What does this initiator node signifies? I thought that those nodes who have recorded their corresponding states. Am I right? I've to write the code in java. Please suggest me the approach or an algorithm to follow.


Solution

  • According to the Wikipedia page on the Chandy-Lamport algorithm:

    The assumptions of the algorithm are as follows:

    • There are no failures and all messages arrive intact and only once
    • The communication channels are unidirectional and FIFO ordered
    • There is a communication path between any two processes in the system
    • Any process may initiate the snapshot algorithm
    • The snapshot algorithm does not interfere with the normal execution of the processes
    • Each process in the system records its local state and the state of its incoming channels

    The algorithm works using marker messages. Each process that wants to initiate a snapshot records its local state and sends a marker on each of its outgoing channels. All the other processes, upon receiving a marker, record their local state, the state of the channel from which the marker just came as empty, and send marker messages on all of their outgoing channels. If a process receives a marker after having recorded its local state, it records the state of the incoming channel from which the marker came as carrying all the messages received since it first recorded its local state.

    You are using slightly different terminology to the Wikipedia description, but I assume that your "nodes" correspond to the "processes" in the above. Thus an "initiator node" is a simply a node that initiates (requests) a snapshot.

    If that is what your terminology means, then with the Chandy-Lamport algorithm, any node could be an initiator node. Hence the answer to the question is "all of them".

    But, given the trivial nature of the answer / solution, I suspect that is not what your assignment really means. Either you have left out some context, or the assignment is misstated. I suggest that you ask your instructor.

    (Or ... maybe it is a "trick question".)