We found when old node is removed from cluster, the tokens in astynanx are not removed, and when new node joins, new tokens are added. This makes the total number of tokens (partitions) at client side is more than server side.
At line 177~181 of TokenPartitionedTopology.java, the logic is to remove the tokens that are no longer in the ring. However, the .remove() method is called on tokenHostMap, which is a local variable and is discarded then. It should be called on this.tokenToPartitionMap.
177 // Remove the tokens that are no longer in the ring
178 for (BigInteger token : tokensToRemove) {
179 tokenHostMap.remove(token);
180 didChange = true;
181 }
We found when old node is removed from cluster, the tokens in astynanx are not removed, and when new node joins, new tokens are added. This makes the total number of tokens (partitions) at client side is more than server side.
At line 177~181 of TokenPartitionedTopology.java, the logic is to remove the tokens that are no longer in the ring. However, the .remove() method is called on tokenHostMap, which is a local variable and is discarded then. It should be called on this.tokenToPartitionMap.
177 // Remove the tokens that are no longer in the ring 178 for (BigInteger token : tokensToRemove) { 179 tokenHostMap.remove(token); 180 didChange = true; 181 }