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

fix https://github.com/chrislusf/seaweedfs/issues/2001
This commit is contained in:
Chris Lu 2021-04-14 10:26:26 -07:00
parent ff4c1d5965
commit 9d50867d08

View file

@ -133,7 +133,7 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, collection strin
// remove the remaining replicas
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 {
fmt.Fprintf(writer, "failed to delete volume %d on %s\n", vid, loc.Url)
}