Ah, maybe I've not made that very clear. The count_by_node view only knows about the current partition table.  When I'm generating a rebalancing plan there are a bunch of moves to compute, and when I'm figuring out the optimal host for the Nth move I care about the partition table as it exists on disk plus the N-1 operations that I've already computed (as the node with the fewest shards on disk has probably already been chosen as a target by one or more of the previous N-1 ops).