diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-06-20 23:46:00 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-06-20 23:46:00 -0700 |
| commit | 613a2e8060c41aab7e58623b8f22b8ed87493b41 (patch) | |
| tree | de2995956f74f424f9933ab9fea7d4b5fdf32da6 | |
| parent | 11be0b5e91180246edf48e0b49f6203cecdca397 (diff) | |
| download | seaweedfs-613a2e8060c41aab7e58623b8f22b8ed87493b41.tar.xz seaweedfs-613a2e8060c41aab7e58623b8f22b8ed87493b41.zip | |
delete garbage only when successful
| -rw-r--r-- | weed/server/filer_grpc_server.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/weed/server/filer_grpc_server.go b/weed/server/filer_grpc_server.go index 1c2d95e1f..bcac4dbde 100644 --- a/weed/server/filer_grpc_server.go +++ b/weed/server/filer_grpc_server.go @@ -114,8 +114,6 @@ func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntr fullpath := filer2.FullPath(filepath.ToSlash(filepath.Join(req.Directory, req.Entry.Name))) chunks, garbages := filer2.CompactFileChunks(req.Entry.Chunks) - fs.filer.DeleteChunks(fullpath, garbages) - if req.Entry.Attributes == nil { return nil, fmt.Errorf("can not create entry with empty attributes") } @@ -127,6 +125,7 @@ func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntr }) if err == nil { + fs.filer.DeleteChunks(fullpath, garbages) } return &filer_pb.CreateEntryResponse{}, err |
