aboutsummaryrefslogtreecommitdiff
path: root/weed/server
diff options
context:
space:
mode:
authorJames Hartig <fastest963@gmail.com>2020-09-01 22:00:00 -0400
committerJames Hartig <fastest963@gmail.com>2020-09-01 22:00:07 -0400
commit8e54e345760c2dca12085311d6fe0cf7eba8b6a9 (patch)
tree638806dd8e32e3fbdff1608c4a56f74ea021a656 /weed/server
parent2b14ae581916f324f8cc6fdf4778d948f9f3b6fd (diff)
downloadseaweedfs-8e54e345760c2dca12085311d6fe0cf7eba8b6a9.tar.xz
seaweedfs-8e54e345760c2dca12085311d6fe0cf7eba8b6a9.zip
volume: Don't unmount before deleting volume in copy
If we unmount first and then delete, the delete fails because the volume was unmounted. Delete ends up doing the same thing as the unmount anyways.
Diffstat (limited to 'weed/server')
-rw-r--r--weed/server/volume_grpc_copy.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/weed/server/volume_grpc_copy.go b/weed/server/volume_grpc_copy.go
index 5c7d5572c..cd2b53c8a 100644
--- a/weed/server/volume_grpc_copy.go
+++ b/weed/server/volume_grpc_copy.go
@@ -27,17 +27,12 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo
glog.V(0).Infof("volume %d already exists. deleted before copying...", req.VolumeId)
- err := vs.store.UnmountVolume(needle.VolumeId(req.VolumeId))
- if err != nil {
- return nil, fmt.Errorf("failed to mount existing volume %d: %v", req.VolumeId, err)
- }
-
- err = vs.store.DeleteVolume(needle.VolumeId(req.VolumeId))
+ err := vs.store.DeleteVolume(needle.VolumeId(req.VolumeId))
if err != nil {
return nil, fmt.Errorf("failed to delete existing volume %d: %v", req.VolumeId, err)
}
- glog.V(0).Infof("deleted exisitng volume %d before copying.", req.VolumeId)
+ glog.V(0).Infof("deleted existing volume %d before copying.", req.VolumeId)
}
location := vs.store.FindFreeLocation()