Skip to content

Commit

Permalink
NAS-130978: Sort disks by size when Treat Disk Size As Minimum is sel…
Browse files Browse the repository at this point in the history
…ected (#10773)

Co-authored-by: Boris Vasilenko <[email protected]>
  • Loading branch information
bvasilenko and bvasilenko authored Oct 2, 2024
1 parent 32f3330 commit ea01680
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ describe('GenerateVdevsService - treat disk size as minimum', () => {

expect(vdevs).toEqual({
[VdevType.Data]: expectDisks([['enclosure1-disk1', 'enclosure1-disk2', 'enclosure1-disk3']]),
[VdevType.Log]: expectDisks([['enclosure2-disk1']]),
[VdevType.Spare]: expectDisks([['small-ssd1']]),
[VdevType.Log]: expectDisks([['small-ssd1']]),
[VdevType.Spare]: expectDisks([['small-ssd2']]),
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export class GenerateVdevsService {
if (suitableDisks.length < disksNeeded) {
return [];
}
suitableDisks.sort((a, b) => a.size - b.size);

let pickedDisks: DetailsDisk[];
if (maximizeDispersal) {
Expand Down

0 comments on commit ea01680

Please sign in to comment.