From 8fbc0a91635ad072122b972a91318b7425cbb498 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 28 Dec 2019 12:59:31 -0800 Subject: [PATCH] fix edge cases --- weed/server/volume_grpc_copy.go | 3 +++ weed/server/volume_grpc_erasure_coding.go | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/weed/server/volume_grpc_copy.go b/weed/server/volume_grpc_copy.go index 8a1ede1b8..a54a1e343 100644 --- a/weed/server/volume_grpc_copy.go +++ b/weed/server/volume_grpc_copy.go @@ -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) } } diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go index d4b0e294e..072d2e1cc 100644 --- a/weed/server/volume_grpc_erasure_coding.go +++ b/weed/server/volume_grpc_erasure_coding.go @@ -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