diff options
| author | chrislu <chris.lu@gmail.com> | 2024-06-15 11:53:19 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-06-15 11:53:19 -0700 |
| commit | 49893267e978cc3fda00dc991e00099742fb5a9d (patch) | |
| tree | 9c91dc3e55445309299b2d35e040ad73b0b69de5 /weed/server | |
| parent | cb1ba0275ac11eaed702b9d31e0d308d73708b7a (diff) | |
| parent | 464611f6143a3eb88f838a183205281a0b3fe177 (diff) | |
| download | seaweedfs-49893267e978cc3fda00dc991e00099742fb5a9d.tar.xz seaweedfs-49893267e978cc3fda00dc991e00099742fb5a9d.zip | |
Merge branch 'master' into mq
Diffstat (limited to 'weed/server')
4 files changed, 8 insertions, 8 deletions
diff --git a/weed/server/filer_grpc_server_remote.go b/weed/server/filer_grpc_server_remote.go index 33049a4f4..991fff425 100644 --- a/weed/server/filer_grpc_server_remote.go +++ b/weed/server/filer_grpc_server_remote.go @@ -184,10 +184,10 @@ func (fs *FilerServer) CacheRemoteObjectToLocalCluster(ctx context.Context, req // this skips meta data log events if err := fs.filer.Store.UpdateEntry(context.Background(), newEntry); err != nil { - fs.filer.DeleteChunks(chunks) + fs.filer.DeleteUncommittedChunks(chunks) return nil, err } - fs.filer.DeleteChunks(garbage) + fs.filer.DeleteChunks(entry.FullPath, garbage) fs.filer.NotifyUpdateEvent(ctx, entry, newEntry, true, false, nil) diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go index f4428be61..2698e2209 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/weed/server/filer_server_handlers_write_autochunk.go @@ -102,12 +102,12 @@ func (fs *FilerServer) doPostAutoChunk(ctx context.Context, w http.ResponseWrite md5bytes = md5Hash.Sum(nil) headerMd5 := r.Header.Get("Content-Md5") if headerMd5 != "" && !(util.Base64Encode(md5bytes) == headerMd5 || fmt.Sprintf("%x", md5bytes) == headerMd5) { - fs.filer.DeleteChunks(fileChunks) + fs.filer.DeleteUncommittedChunks(fileChunks) return nil, nil, errors.New("The Content-Md5 you specified did not match what we received.") } filerResult, replyerr = fs.saveMetaData(ctx, r, fileName, contentType, so, md5bytes, fileChunks, chunkOffset, smallContent) if replyerr != nil { - fs.filer.DeleteChunks(fileChunks) + fs.filer.DeleteUncommittedChunks(fileChunks) } return @@ -129,12 +129,12 @@ func (fs *FilerServer) doPutAutoChunk(ctx context.Context, w http.ResponseWriter md5bytes = md5Hash.Sum(nil) headerMd5 := r.Header.Get("Content-Md5") if headerMd5 != "" && !(util.Base64Encode(md5bytes) == headerMd5 || fmt.Sprintf("%x", md5bytes) == headerMd5) { - fs.filer.DeleteChunks(fileChunks) + fs.filer.DeleteUncommittedChunks(fileChunks) return nil, nil, errors.New("The Content-Md5 you specified did not match what we received.") } filerResult, replyerr = fs.saveMetaData(ctx, r, fileName, contentType, so, md5bytes, fileChunks, chunkOffset, smallContent) if replyerr != nil { - fs.filer.DeleteChunks(fileChunks) + fs.filer.DeleteUncommittedChunks(fileChunks) } return diff --git a/weed/server/filer_server_handlers_write_cipher.go b/weed/server/filer_server_handlers_write_cipher.go index 1874a41fc..6cf7d65b1 100644 --- a/weed/server/filer_server_handlers_write_cipher.go +++ b/weed/server/filer_server_handlers_write_cipher.go @@ -91,7 +91,7 @@ func (fs *FilerServer) encrypt(ctx context.Context, w http.ResponseWriter, r *ht } if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil, false, so.MaxFileNameLength); dbErr != nil { - fs.filer.DeleteChunks(entry.GetChunks()) + fs.filer.DeleteUncommittedChunks(entry.GetChunks()) err = dbErr filerResult.Error = dbErr.Error() return diff --git a/weed/server/filer_server_handlers_write_upload.go b/weed/server/filer_server_handlers_write_upload.go index e26eecbe8..8c8eba078 100644 --- a/weed/server/filer_server_handlers_write_upload.go +++ b/weed/server/filer_server_handlers_write_upload.go @@ -132,7 +132,7 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque wg.Wait() if uploadErr != nil { - fs.filer.DeleteChunks(fileChunks) + fs.filer.DeleteUncommittedChunks(fileChunks) return nil, md5Hash, 0, uploadErr, nil } slices.SortFunc(fileChunks, func(a, b *filer_pb.FileChunk) int { |
