Hello,
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!
Hello,
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!
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.
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.
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:
If you're interested, have a look at the algorithm used for gossiping with other nodes in the Gossiper.java
class (link to C* 3.11.6), specifically the private GossipTask
class and the sendGossip()
method. Cheers!
5 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use