diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-08-08 15:12:39 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-08-08 15:12:39 -0700 |
| commit | 26c222f59684d438b13042398f69952b006dafe9 (patch) | |
| tree | e00909467203fc2ed23a90c8f1903508fc9025df /weed/shell/command_volume_tier_move.go | |
| parent | de730b079da4d9e046c4816a4f74a19c4ddf6712 (diff) | |
| download | seaweedfs-26c222f59684d438b13042398f69952b006dafe9.tar.xz seaweedfs-26c222f59684d438b13042398f69952b006dafe9.zip | |
shell: volume.tier.move avoid moving all volumes to one destination
Diffstat (limited to 'weed/shell/command_volume_tier_move.go')
| -rw-r--r-- | weed/shell/command_volume_tier_move.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/shell/command_volume_tier_move.go b/weed/shell/command_volume_tier_move.go index 19a515dab..355063ded 100644 --- a/weed/shell/command_volume_tier_move.go +++ b/weed/shell/command_volume_tier_move.go @@ -122,6 +122,8 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, vid needle.Volum hasFoundTarget = true if !applyChanges { + // adjust volume count + dst.dataNode.DiskInfos[string(toDiskType)].VolumeCount++ break } @@ -133,6 +135,9 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, vid needle.Volum return fmt.Errorf("move volume %d %s => %s : %v", vid, locations[0].Url, dst.dataNode.Id, err) } + // adjust volume count + dst.dataNode.DiskInfos[string(toDiskType)].VolumeCount++ + // remove the remaining replicas for _, loc := range locations { if loc.Url != dst.dataNode.Id { |
