If a broker is being decommissioned and it's already empty, we don't have any need to move other topics. Thus, partitions_to_move is an empty set.
Currently, the code will crash with an error:
[2021-11-09 15:36:05,992] [CRITICAL:main] Uncaught exception:
Traceback (most recent call last):
...
File "<>/site-packages/kafka_utils/kafka_cluster_manager/cmds/decommission.py", line 112, in run_command
for partition in partitions_to_move
ValueError: max() arg is an empty sequence
I added a unit test to reproduce this issue (it failed without these changes), and it passes now.
My understanding is that if the partitions_to_move is empty, then self.args.max_movement_size being 1 doesn't have any impact.
If a broker is being decommissioned and it's already empty, we don't have any need to move other topics. Thus,
partitions_to_move
is an empty set.Currently, the code will crash with an error:
I added a unit test to reproduce this issue (it failed without these changes), and it passes now.
My understanding is that if the
partitions_to_move
is empty, thenself.args.max_movement_size
being 1 doesn't have any impact.Release Plan
Patch version release