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
Fix large file chunks deleted by mistake (#4678)
wusong33b9192536ce
diff --git a/weed/mount/weedfs_xattr.go b/weed/mount/weedfs_xattr.goindex b03fa01f11..e1d6d43514 100644--- a/weed/mount/weedfs_xattr.go+++ b/weed/mount/weedfs_xattr.go@@ -1,11 +1,12 @@package mountimport (- "github.com/hanwen/go-fuse/v2/fuse"- sys "golang.org/x/sys/unix""runtime""strings""syscall"++ "github.com/hanwen/go-fuse/v2/fuse"+ sys "golang.org/x/sys/unix")const (@@ -131,6 +132,11 @@ func (wfs *WFS) SetXAttr(cancel <-chan struct{}, input *fuse.SetXAttrIn, attr stentry.Extended[XATTR_PREFIX+attr] = data}+ if fh != nil {+ fh.dirtyMetadata = true+ return fuse.OK+ }+return wfs.saveEntry(path, entry)}diff --git a/weed/server/filer_grpc_server.go b/weed/server/filer_grpc_server.goindex d67bd425e6..7607af6643 100644--- a/weed/server/filer_grpc_server.go+++ b/weed/server/filer_grpc_server.go@@ -3,12 +3,13 @@ package weed_serverimport ("context""fmt"- "github.com/seaweedfs/seaweedfs/weed/cluster""os""path/filepath""strconv""time"+ "github.com/seaweedfs/seaweedfs/weed/cluster"+"github.com/seaweedfs/seaweedfs/weed/filer""github.com/seaweedfs/seaweedfs/weed/glog""github.com/seaweedfs/seaweedfs/weed/operation"@@ -157,7 +158,7 @@ func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntrcreateErr := fs.filer.CreateEntry(ctx, newEntry, req.OExcl, req.IsFromOtherCluster, req.Signatures, req.SkipCheckParentDirectory)if createErr == nil {- fs.filer.DeleteChunks(garbage)+ fs.filer.DeleteChunksNotRecursive(garbage)} else {glog.V(3).Infof("CreateEntry %s: %v", filepath.Join(req.Directory, req.Entry.Name), createErr)resp.Error = createErr.Error()@@ -189,7 +190,7 @@ func (fs *FilerServer) UpdateEntry(ctx context.Context, req *filer_pb.UpdateEntr}if err = fs.filer.UpdateEntry(ctx, entry, newEntry); err == nil {- fs.filer.DeleteChunks(garbage)+ fs.filer.DeleteChunksNotRecursive(garbage)fs.filer.NotifyUpdateEvent(ctx, entry, newEntry, true, req.IsFromOtherCluster, req.Signatures)