hash_ring
Bot releases are visible (Hide)
Removes that for now, so it can install.
Published by jhgg over 6 years ago
Merge #2
Rebuilding the ring each time the ring changes turns out to be a really slow operation. This hopes to address this by creating an add_nodes
operation that can be performed on an empty ring that is faster than individually calling add_node
for each node in the ring. So far, the benchmarks are promising, the add_nodes
operation taking 2% the wall time of calling add_node
individually for larger ring sizes. Right now, this operation will run in the event loop of our API servers, so making it go faster is a good way to reduce the impact of re-building the ring.
Here is a result of the benches of adding nodes in the slow (add_node) vs fast (add_nodes) path, for 512 replicas per node:
HashRing.add_nodes(nodes)
method.HashRing.get_num_items()
method for debugging.HashRing.get_node(node_name)
method for debugging.hash_ring_sort
method that will sort the ring items array after we're done adding stuff tohash_ring_ensure_items_size
which will allow us to pre-allocate the items
array, so we do not need to needlessly realloc it to grow, if we can compute the target size before hand.hash_ring_add_node
to take a doSort
param, to defer sorting of the items array.Published by jhgg over 6 years ago
Add support for dynamic replicas. See #1 for more details.