From 86657ed3a808541c23ccb4486e8defee44963306 Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 10 Jan 2023 01:35:10 -0800 Subject: [PATCH] avoid repeatedly adding manifest chunks --- weed/mount/weedfs_file_sync.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weed/mount/weedfs_file_sync.go b/weed/mount/weedfs_file_sync.go index ac18e05ea..e830a4210 100644 --- a/weed/mount/weedfs_file_sync.go +++ b/weed/mount/weedfs_file_sync.go @@ -152,13 +152,14 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status { manifestChunks, nonManifestChunks := filer.SeparateManifestChunks(entry.GetChunks()) chunks, _ := filer.CompactFileChunks(wfs.LookupFn(), nonManifestChunks) + fh.entryChunkGroup.SetChunks(chunks) + chunks, manifestErr := filer.MaybeManifestize(wfs.saveDataAsChunk(fileFullPath), chunks) if manifestErr != nil { // not good, but should be ok glog.V(0).Infof("MaybeManifestize: %v", manifestErr) } entry.Chunks = append(chunks, manifestChunks...) - fh.entryChunkGroup.SetChunks(entry.Chunks) wfs.mapPbIdFromLocalToFiler(request.Entry) defer wfs.mapPbIdFromFilerToLocal(request.Entry)