From 665917fdf1c11f9558e0ab70e9e0f8503e4299ed Mon Sep 17 00:00:00 2001 From: wusong <75450248+wusongANKANG@users.noreply.github.com> Date: Wed, 1 Feb 2023 10:54:46 +0800 Subject: [PATCH 1/3] [mount]: delete redundant code (#4173) --- weed/mount/weedfs_file_mkrm.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/mount/weedfs_file_mkrm.go b/weed/mount/weedfs_file_mkrm.go index 02171fe99..2da316a50 100644 --- a/weed/mount/weedfs_file_mkrm.go +++ b/weed/mount/weedfs_file_mkrm.go @@ -3,12 +3,13 @@ package mount import ( "context" "fmt" + "syscall" + "time" + "github.com/hanwen/go-fuse/v2/fuse" "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" - "syscall" - "time" ) /** @@ -144,7 +145,6 @@ func (wfs *WFS) Unlink(cancel <-chan struct{}, header *fuse.InHeader, name strin return fuse.EIO } - wfs.metaCache.DeleteEntry(context.Background(), entryFullPath) wfs.inodeToPath.RemovePath(entryFullPath) return fuse.OK From b9b613a78e2832565e0ec6fc703e3cd4e066ee16 Mon Sep 17 00:00:00 2001 From: Neo Date: Wed, 1 Feb 2023 10:56:11 +0800 Subject: [PATCH 2/3] filter system log dir does not make subscribe event (#4172) --- weed/filer/filer.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/weed/filer/filer.go b/weed/filer/filer.go index 07d40acc8..f6f06d9b2 100644 --- a/weed/filer/filer.go +++ b/weed/filer/filer.go @@ -3,14 +3,15 @@ package filer import ( "context" "fmt" - "github.com/seaweedfs/seaweedfs/weed/cluster" - "github.com/seaweedfs/seaweedfs/weed/pb" - "github.com/seaweedfs/seaweedfs/weed/pb/master_pb" "os" "sort" "strings" "time" + "github.com/seaweedfs/seaweedfs/weed/cluster" + "github.com/seaweedfs/seaweedfs/weed/pb" + "github.com/seaweedfs/seaweedfs/weed/pb/master_pb" + "google.golang.org/grpc" "github.com/seaweedfs/seaweedfs/weed/glog" @@ -254,7 +255,9 @@ func (f *Filer) ensureParentDirectoryEntry(ctx context.Context, entry *Entry, di return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr) } } else { - f.NotifyUpdateEvent(ctx, nil, dirEntry, false, isFromOtherCluster, nil) + if !strings.HasPrefix("/"+util.Join(dirParts[:]...), SystemLogDir) { + f.NotifyUpdateEvent(ctx, nil, dirEntry, false, isFromOtherCluster, nil) + } } } else if !dirEntry.IsDirectory() { From fe573f26a8db0a4c3bbd5e645c4fa2192683c97e Mon Sep 17 00:00:00 2001 From: wusong <75450248+wusongANKANG@users.noreply.github.com> Date: Wed, 1 Feb 2023 11:36:59 +0800 Subject: [PATCH 3/3] memchunk save content twice (#4174) --- weed/mount/page_writer/page_chunk_mem.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/weed/mount/page_writer/page_chunk_mem.go b/weed/mount/page_writer/page_chunk_mem.go index 3928f7077..70814262d 100644 --- a/weed/mount/page_writer/page_chunk_mem.go +++ b/weed/mount/page_writer/page_chunk_mem.go @@ -1,10 +1,11 @@ package page_writer import ( - "github.com/seaweedfs/seaweedfs/weed/util" - "github.com/seaweedfs/seaweedfs/weed/util/mem" "sync" "sync/atomic" + + "github.com/seaweedfs/seaweedfs/weed/util" + "github.com/seaweedfs/seaweedfs/weed/util/mem" ) var ( @@ -100,11 +101,6 @@ func (mc *MemChunk) SaveContent(saveFn SaveToStorageFunc) { if saveFn == nil { return } - for t := mc.usage.head.next; t != mc.usage.tail; t = t.next { - reader := util.NewBytesReader(mc.buf[t.StartOffset:t.stopOffset]) - saveFn(reader, int64(mc.logicChunkIndex)*mc.chunkSize+t.StartOffset, t.Size(), t.TsNs, func() { - }) - } for t := mc.usage.head.next; t != mc.usage.tail; t = t.next { startOffset := t.StartOffset