aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-01-18 09:14:01 -0800
committerchrislu <chris.lu@gmail.com>2024-01-18 09:14:01 -0800
commit2fa519bcb5408375783a586ba8e853069969a498 (patch)
treef58eb55d2d0c669453e5ad5cccca1b6ae358b922 /weed/command
parent3002087541f2d4447cbccd67c48554b7b86772b1 (diff)
parent15b66a6633149a2e99ef5d53cd788bdfd143e8b7 (diff)
downloadseaweedfs-2fa519bcb5408375783a586ba8e853069969a498.tar.xz
seaweedfs-2fa519bcb5408375783a586ba8e853069969a498.zip
Merge branch 'pr/5216'
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/filer_remote_sync_dir.go7
-rw-r--r--weed/command/filer_sync.go5
2 files changed, 10 insertions, 2 deletions
diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go
index 00f6d7493..dd3e94be6 100644
--- a/weed/command/filer_remote_sync_dir.go
+++ b/weed/command/filer_remote_sync_dir.go
@@ -278,7 +278,10 @@ func updateLocalEntry(filerClient filer_pb.FilerClient, dir string, entry *filer
}
func isMultipartUploadFile(dir string, name string) bool {
+ return isMultipartUploadDir(dir) && strings.HasSuffix(name, ".part")
+}
+
+func isMultipartUploadDir(dir string) bool {
return strings.HasPrefix(dir, "/buckets/") &&
- strings.Contains(dir, "/"+s3_constants.MultipartUploadsFolder+"/") &&
- strings.HasSuffix(name, ".part")
+ strings.Contains(dir, "/"+s3_constants.MultipartUploadsFolder+"/")
}
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index 20464fa50..dc954e805 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -11,6 +11,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/replication/sink"
"github.com/seaweedfs/seaweedfs/weed/replication/sink/filersink"
"github.com/seaweedfs/seaweedfs/weed/replication/source"
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/security"
statsCollect "github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/util"
@@ -394,6 +395,10 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
glog.V(0).Infof("received %v", resp)
}
+ if isMultipartUploadDir(resp.Directory) {
+ return nil
+ }
+
if !strings.HasPrefix(resp.Directory, sourcePath) {
return nil
}