SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
delete chunks only when file writing is successful
Chris Lu4b0f084b5db4
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.goindex 60c50c95cb..577403cef0 100644--- a/weed/filesys/filehandle.go+++ b/weed/filesys/filehandle.go@@ -160,12 +160,13 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error {chunks, garbages := filer2.CompactFileChunks(fh.f.entry.Chunks)fh.f.entry.Chunks = chunks// fh.f.entryViewCache = nil- fh.f.wfs.deleteFileChunks(ctx, garbages)if _, err := client.CreateEntry(ctx, request); err != nil {return fmt.Errorf("update fh: %v", err)}+ fh.f.wfs.deleteFileChunks(ctx, garbages)+return nil})}