Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

add error to avoid copying not found volume

Chris Lu91b91d6cb748
diff --git a/weed/server/volume_grpc_copy.go b/weed/server/volume_grpc_copy.go
index 7db23fae17..5c7d5572cb 100644
--- a/weed/server/volume_grpc_copy.go
+++ b/weed/server/volume_grpc_copy.go
@@ -82,6 +82,13 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo
return nil
})
+ if err != nil {
+ return nil, err
+ }
+ if volumeFileName == "" {
+ return nil, fmt.Errorf("not found volume %d file", req.VolumeId)
+ }
+
idxFileName = volumeFileName + ".idx"
datFileName = volumeFileName + ".dat"
@@ -93,10 +100,6 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo
}
}()
- if err != nil && volumeFileName != "" {
- return nil, err
- }
-
if err = checkCopyFiles(volFileInfoResp, idxFileName, datFileName); err != nil { // added by panyc16
return nil, err
}