Database Reference
In-Depth Information
Implementation-wise, the gossip task is handled by the
org.apache.cassandra.gms.Gossiper class. The Gossiper class maintains a
list of live and dead endpoints (the unreachable endpoints). At each one-second interval,
this module starts a gossip round with a randomly chosen node. A full round of gossip
consists of three messages. A node X sends a syn message to a node Y to initiate gossip.
Y, on receipt of this syn message, sends an ack message back to X. To reply to this ack
message, X sends an ack2 message to Y completing a full message round. The following
figure shows the two nodes gossiping:
Note
Syn and ack are also known as a message handshake . It is a mechanism that allows two
machines trying to communicate to each other to negotiate the parameters of connection
before transmitting data. Syn stands for "synchronize packet" and ack stands for "acknow-
ledge packet".
The Gossiper module is linked to failure detection. The module, on hearing one of
these messages, updates the failure detector with the liveness information that it has
gained. If it hears GossipShutdownMessage , the module marks the remote node as
dead in the failure detector.
The node to be gossiped with is chosen based on the following rules:
• Gossip to a random live endpoint
• Gossip to a random unreachable endpoint
• If the node in point 1 was not a seed node or the number of live nodes is less than
the number of seeds, gossip to a random seed
Note
Seed node
Seed nodes are the nodes that are first contacted by a newly joining node when they first
start up. Seed nodes help the newly started node to discover other nodes in the cluster. It is
suggested that to have more than one seed node in a cluster.Seed node is nothing
Search WWH ::




Custom Search