Browse Source
ec: fix variable shadowing and add -diskType to ec.rebuild and volumeServer.evacuate
ec: fix variable shadowing and add -diskType to ec.rebuild and volumeServer.evacuate
Address code review comments:
1. Fix variable shadowing in collectEcVolumeServersByDc():
- Rename loop variable 'diskType' to 'diskTypeKey' and 'diskTypeStr'
to avoid shadowing the function parameter
2. Fix hardcoded HardDriveType in ecBalancer methods:
- balanceEcRack(): use ecb.diskType instead of types.HardDriveType
- collectVolumeIdToEcNodes(): use ecb.diskType
3. Add -diskType flag to ec.rebuild command:
- Add diskType field to ecRebuilder struct
- Pass diskType to collectEcNodes() and addEcVolumeShards()
4. Add -diskType flag to volumeServer.evacuate command:
- Add diskType field to commandVolumeServerEvacuate struct
- Pass diskType to collectEcVolumeServersByDc() and moveMountedShardToEcNode()
ec-disk-type-support
3 changed files with 28 additions and 15 deletions
-
18weed/shell/command_ec_common.go
-
12weed/shell/command_ec_rebuild.go
-
13weed/shell/command_volume_server_evacuate.go
Write
Preview
Loading…
Cancel
Save
Reference in new issue