Each Cassandra node keeps token ownership in two separate caches. 1) Gossip cache 2) StorageService cache. The first Gossip cache is updated on a node, followed by the storage service cache. In the hot path, ownership is calculated from the storage service cache. Since two separate caches maintain the same information, inconsistencies are bound to happen. It is feasible that the Gossip cache has up-to-date ownership of the Cassandra cluster, but the service cache does not, and in that scenario, inconsistent data will be served to the user.
No mechanism in Cassandra exists that detects and fixes these two caches. The following Ticket/PR attempts to reduce the out-of-range token issues. *Long-term solution:* The long-term solution is TSM (CEP-21), but it might take some time as it will be in 5.1, and the folks currently on 4.x could have to wait for some time before taking full advantage of TSM. In the interim, this PR provides some relief! *Ticket:* https://issues.apache.org/jira/browse/CASSANDRA-18758 *PR (on 4.1):* https://github.com/apache/cassandra/pull/3548 Jaydeep