Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is mitigation for the broader problems referred to in - basho/riak#981.
This change is tested in:
https://github.com/nhs-riak/riak_test/blob/mas-i981-resethashtreetokens/tests/verify_aae_resettoken.erl
The idea is that in some circumstances we want to temporarily ensure that writes aren't blocked by AAE hashtree_token depletion. This might be to prove that this isn't an issue behind slow writes, or because there is a need for coordinated AAE tree rebuilds to mitigate some other issue.
This can be managed through
riak attach
:Get the current min and max token count across the cluster:
{Min, Max} = riak_kv_util:return_hashtree_tokens().
Set the max token count to be in a range between very large numbers on each vnode:
riak_kv_util:reset_hashtree_tokens(200000, 250000).
After completing any related work, reset back to the original range:
riak_kv_util:reset_hashtree_tokens(Min, Max).
This will work from any node in the cluster, across the cluster, in a healthy cluster. There is no need to run the commands on each node.