Browse Source

volume.tier.move: avoid data loss when destination volume server already has the volume

fix https://github.com/chrislusf/seaweedfs/issues/2001
pull/2008/head
Chris Lu 4 years ago
parent
commit
9d50867d08
  1. 2
      weed/shell/command_volume_tier_move.go

2
weed/shell/command_volume_tier_move.go

@ -133,7 +133,7 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, collection strin
// remove the remaining replicas // remove the remaining replicas
for _, loc := range locations { for _, loc := range locations {
if loc.Url != sourceVolumeServer {
if loc.Url != dst.dataNode.Id {
if err = deleteVolume(commandEnv.option.GrpcDialOption, vid, loc.Url); err != nil { if err = deleteVolume(commandEnv.option.GrpcDialOption, vid, loc.Url); err != nil {
fmt.Fprintf(writer, "failed to delete volume %d on %s\n", vid, loc.Url) fmt.Fprintf(writer, "failed to delete volume %d on %s\n", vid, loc.Url)
} }

Loading…
Cancel
Save