mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add error to avoid copying not found volume
fix https://github.com/chrislusf/seaweedfs/issues/1317
This commit is contained in:
parent
d3925d086c
commit
91b91d6cb7
|
@ -82,6 +82,13 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if volumeFileName == "" {
|
||||||
|
return nil, fmt.Errorf("not found volume %d file", req.VolumeId)
|
||||||
|
}
|
||||||
|
|
||||||
idxFileName = volumeFileName + ".idx"
|
idxFileName = volumeFileName + ".idx"
|
||||||
datFileName = volumeFileName + ".dat"
|
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
|
if err = checkCopyFiles(volFileInfoResp, idxFileName, datFileName); err != nil { // added by panyc16
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue