Once the broker has been chosen for a replica partition, the next step is to choose the directory on the broker where the partition will place its data. The algorithm applied to choose the directory simply picks the directory with the least number of partitions. This implies that a newly added directory will receive all the new partitions.
Note that when allocating partitions to a directory, the size of the disk or load isn’t factored in. Instead, just the number of existing partitions on the disk is considered. You may need to exercise caution if a broker has disks of different sizes because it may lead to a large partition being allocated on a directory that has fewer partitions but has a greater portion of its total space used. This means they will continue to receive new partitions, even though there are other available disks that have a lower effective load.