Open In App

Working of GOSSIP protocol in Cassandra

Last Updated : 17 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will discuss the overview of Gossip protocol and mainly focus on working of gossip protocol and what is the role in the cluster to communicate with other nodes. Let’s discuss it one by one.

Gossip protocol :
In Cassandra, the nodes communicate with each other that is through gossip protocol. The main role of the gossip protocol is to identify what other nodes are doing in a ring. The main existence of the Gossip protocol to ensure that each node knows the state of itself and every other node in the ring.

 

Working of Gossip Protocol :
In this, we will discuss the working of the Gossip protocol where we will see how actually Gossip protocol works and will mainly focus on how communication happened between two nodes. Gossip protocol has to ability to know how other nodes are doing and find other nodes up to. Now, we will discuss the functioning one by one.

It is most likely a TCP 3-way handshake protocol. 

  1. SYN –
    In the synchronization part, it will send the GossipDigestSynMessage request to receiving node in a cluster, and receiving node will get this request and will respond accordingly.
     
  2. ACK –
    After requesting synchronization and once receiving node will get the request then it will acknowledge the request and will send the GossipDigestAckMessage.  
     
  3. ACK2 –
    Finally, the initial node will get acknowledge then it will send GossipDigestAck2Message to the receiving node to acknowledge the acknowledgment response from receiving node.

Working steps of Gossip protocol :

  1. Initially, To receive endpoint state information, it will be done when Cassandra starts up, it registers itself with the Gossiper.
  2. After that, Periodically, typically once per second then Gossiper will choose the random node in a ring to start a Gossip session.
  3. After that, Initiating node will send the request GossipDigestSynMessage to the receiving node which simply means that it is requesting a synchronization.
  4. After that, when receiving node will get the request then it will acknowledge the request with GossipDigestAckMessage message to acknowledge the request.
  5. Finally, when Initiating node will get the acknowledgment from receiving node then again it will send the acknowledgment with GossipDigestAck2Message.

References :
https://wiki.apache.org/cassandra/ArchitectureGossip


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads