When a new Cassandra node joins the cluster for the first time it is assigned a random token. But it can match with an already existing token in the ring. What is the token conflict detection and resolution mechanism of Cassandra?
When a new Cassandra node joins the cluster for the first time it is assigned a random token. But it can match with an already existing token in the ring. What is the token conflict detection and resolution mechanism of Cassandra?
The token ranges really aren’t assigned randomly. When a new node joins the cluster, the token ranges of existing nodes are bisected and reassigned to the new node. Therefore, a token “collision” really isn’t a possibility.
I should note that if you are running with multiple nodes and a replication factor > 1 (which you should be), that token ranges are replicated to neighboring nodes as a secondary range. This helps to enforce high availability of your data in the event of a hardware failure. But that still wouldn’t result in a collision.