if specified topic add|rebalance --broker param with attrs (i.e. *[rack]), it now sorts broker list by specified attr value;
rebalance now uses initial offset and partition id (previously was random value), so it would produce same result for sequential runs;
As a consequence, it should distribute correctly partitions of newly created or rebalanced topic taking into account actual attribute value. For instance, if we have 5 brokers in 3 racks and creating a topic with 3 partitions it will select brokers with different rack values. On the other hand, if the number of partitions is larger than brokers count the behavior would be +/- the same as before (we should use all available brokers in that case).
Hey,
Following changes were added:
As a consequence, it should distribute correctly partitions of newly created or rebalanced topic taking into account actual attribute value. For instance, if we have 5 brokers in 3 racks and creating a topic with 3 partitions it will select brokers with different rack values. On the other hand, if the number of partitions is larger than brokers count the behavior would be +/- the same as before (we should use all available brokers in that case).
Please review & merge.