1
0

Increase range of rebalance interval

This both simplifies the code, and ensures that the target node is
roughly in the center of the range rather than at an end.
This commit is contained in:
Erik Johnston
2018-05-17 15:09:31 +01:00
parent c771c124d5
commit d4e4a7344f

View File

@@ -264,15 +264,11 @@ class ChunkDBOrderedListStore(OrderedListStore):
with Measure(self.clock, "chunk_rebalance"):
# We pick the interval to try and minimise the number of decimal
# places, i.e. we round to nearest float with `rebalance_digits` and
# use that as the middle of the interval
# use that as one side of the interval
order = self._get_order(node_id)
a = round(order, self.rebalance_digits)
if order > a:
min_order = a
max_order = a + 10 ** -self.rebalance_digits
else:
min_order = a - 10 ** -self.rebalance_digits
max_order = a
min_order = a - 10 ** -self.rebalance_digits
max_order = a + 10 ** -self.rebalance_digits
# Now we get all the nodes in the range. We add the minimum difference
# to the bounds to ensure that we don't accidentally move a node to be