Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started



lingzi.kong_192056 avatar image
lingzi.kong_192056 asked lingzi.kong_192056 commented

Do nodes remember which nodes they gossiped with before?


The information in the two screenshots below seems conflicting. Can you please help explain whether nodes remember the other nodes they have ever gossiped with before?

Thank you in advance!

1592533822545.png (54.7 KiB)
1592533832697.png (343.6 KiB)
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered lingzi.kong_192056 commented

That's a fantastic question to ask! You've obviously been paying attention to the course. ;)

I can see where the wording in the two statements could be confusing because they are referring to two different things. I'll try to explain the differences.

Docs - About Gossip

On the Internode communications page, this statement refers to nodes knowing about the topology of the cluster (other nodes) even after it has been restarted:

By default, a node remembers other nodes it has gossiped with between subsequent restarts.

Each node records cluster topology information that other nodes have shared over gossip in the system.peers table. It includes information such as IP address, host ID, data center and assigned tokens:

CREATE TABLE system.peers (
    peer inet PRIMARY KEY,
    data_center text,
    host_id uuid,
    preferred_ip inet,
    rack text,
    release_version text,
    rpc_address inet,
    schema_version uuid,
    tokens set<text>

This is a table in Cassandra and so is persistent across restarts.

Course - DS201 C* Foundations

In the Gossip unit of the DS201 Academy course, this statement refers to nodes not knowing about which nodes they gossiped with in the prior round of gossip:

Nodes do not track which nodes they gossiped with prior

The key in that statement is "prior".

As the slide states, a node initiates a round of gossip every second. It picks up to 3 nodes to gossip with but it does not choose which nodes -- they are picked randomly. It does not track which nodes it gossiped with in the prior rounds but it knows the state of other nodes based on the last time they gossiped with each other.

And those are the key points of differentiation:

  • not remembering the nodes it gossiped with in the prior gossip round, versus
  • remembering information about nodes it gossiped with.

If you're interested, have a look at the algorithm used for gossiping with other nodes in the class (link to C* 3.11.6), specifically the private GossipTask class and the sendGossip() method. Cheers!

1 comment Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thank you so much for the detailed explanation!

1 Like 1 ·