fix edge cases

This commit is contained in:
Chris Lu 2019-12-28 12:59:31 -08:00
parent 37b64a50b4
commit 8fbc0a9163
2 changed files with 4 additions and 3 deletions

View file

@ -214,6 +214,9 @@ func (vs *VolumeServer) CopyFile(req *volume_server_pb.CopyFileRequest, stream v
}
}
if fileName == "" {
if req.IgnoreSourceFileNotFound {
return nil
}
return fmt.Errorf("CopyFile not found ec volume id %d", req.VolumeId)
}
}

View file

@ -200,9 +200,7 @@ func (vs *VolumeServer) VolumeEcShardsDelete(ctx context.Context, req *volume_se
if err := os.Remove(baseFilename + ".ecj"); err != nil {
return nil, err
}
if err := os.Remove(baseFilename + ".vif"); err != nil {
return nil, err
}
os.Remove(baseFilename + ".vif")
}
return &volume_server_pb.VolumeEcShardsDeleteResponse{}, nil