From 205ecb5d0311ec4b37ecae7c43617f931191f59a Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 9 Sep 2022 22:57:38 -0700 Subject: [PATCH] skip directories under ".uploads" directory related to https://github.com/seaweedfs/seaweedfs/issues/3636 skipping all directories under ".uploads" directory. --- weed/command/filer_remote_sync_dir.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go index 00b3cd61e..6f061bda8 100644 --- a/weed/command/filer_remote_sync_dir.go +++ b/weed/command/filer_remote_sync_dir.go @@ -3,6 +3,7 @@ package command import ( "context" "fmt" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" "os" "strings" "time" @@ -107,6 +108,9 @@ func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, return nil } if filer_pb.IsCreate(resp) { + if strings.Contains(message.NewParentPath, "/"+s3_constants.MultipartUploadsFolder+"/") { + return nil + } if !filer.HasData(message.NewEntry) { return nil } @@ -156,7 +160,9 @@ func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, glog.V(2).Infof("update: %+v", resp) glog.V(0).Infof("delete %s", remote_storage.FormatLocation(oldDest)) if err := client.DeleteFile(oldDest); err != nil { - return err + if !strings.Contains(resp.Directory, "/"+s3_constants.MultipartUploadsFolder+"/") { + return err + } } remoteEntry, writeErr := retriedWriteFile(client, filerSource, message.NewEntry, dest) if writeErr != nil {