-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a better default for num_tokens #324
Comments
@jsanda, if we cannot use the new token allocation algorithm, then we need to stick with 256 vnodes. We learned to live with it and the biggest problem with it was repair. Since k8ssandra ships with Reaper and Reaper groups token ranges with the same replicas into segments that will be processed by 3.11 in a single repair session, we're mostly fine. There's a little trick we could use though in order to go as low as 16 and still use the new algorithm: The Is this something we could pull off with cass-operator? |
Can we not use this property to the Management API to get the Keyspace setup to use the allocate_tokens_for_keyspace?
|
@JeremiahDJordan That's a great question. My understanding of what needs to happen is based off of https://thelastpickle.com/blog/2019/02/21/set-up-a-cluster-with-even-token-distribution.html. Assuming we need to implement some or all of those steps I think it would have to happen after 1.0. Presumably, cass-operator would need to calculate the tokens. AFAIK it does not do this currently. I am not sure if we would need changes in cass-operator so that it starts the seed node per rack vs bringing a rack up at a time. I assume the latter since it is the StatefulSet controller that manages the pod creation. Lastly I am not sure if cass-operator and config-builder support specifying different tokens for nodes. |
As long as there is a keyspace existing with a good RF, then you can use |
Not sure what you are referencing here. Shouldn't need to calculate any tokens, just setting |
Assuming we cannot use If we are running 4.0, then we should use the 4.0 default of 16 tokens since the smart token allocation is enabled by default. |
I am basing my limited understanding off of https://thelastpickle.com/blog/2019/02/21/set-up-a-cluster-with-even-token-distribution.html. It outlines the steps that need to be performed. The first step it mentions is calculating and setting tokens fo seed nodes in each rack. |
Ah, you don't need to do that. The seed nodes should just do random calculation. Then the non-seed nodes use the algorithm to "fill out" the ring. The seed node purposefully use random distribution, the algorithm was designed with a random starting point in mind. |
@JeremiahDJordan can you provide a short list of the steps? Maybe it is less work than I originally thought. If it is doable, then we could use the same default as 4.0 which would greatly simplify upgrades. |
@jsanda it should just be
|
I just confirmed that cass-operator starts seed nodes first so I think using I suppose we can default to RF=3 and expose a property in values.yaml for the RF. We should include detailed documentation with the property that explains |
It looks like we will need to add support for |
@burmanm since we do not yet have support for |
Is your feature request related to a problem? Please describe.
The default behavior of cass-operator is to create the Cassandra cluster with vnodes enabled and a single token per node. As an aside cass-operator does not support manual token assignments.
The out of box default for Cassandra is
num_tokens: 256
. Experience over time has shown that this is not a good default. In fact a couple Netflix engineers published a white paper titled Cassandra Availability with Virtual Nodes that discusses how 256 tokens actually decreases availability.Given the problems with using 256 tokens, it makes sense that cass-operator chooses a different value. The
nodetool
output from a couple test clusters demonstrate the problem with a single token:Token range ownership is way out of balance which can cause major issues as the load in the cluster increases.
Describe the solution you'd like
We need a more sensible default for
num_tokens
for the 1.0 release.@adejanovski you have done a good bit of analysis in this area. What are your thoughts? Keep in mind we are looking for a better default for 3.11.x in particular at the moment and also that the even token distribution algorithm is not an option (at least not in the 1.0 time frame).
The text was updated successfully, but these errors were encountered: