Skip to content

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.

filer.sync: fix when excluded paths is empty

chrislu0e9478488dcf
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index fe1606d8c1..9d5b9d8319 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -143,7 +143,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
grpcDialOption,
filerA,
*syncOptions.aPath,
- strings.Split(*syncOptions.aExcludePaths, ","),
+ util.Split(*syncOptions.aExcludePaths, ","),
*syncOptions.aProxyByFiler,
filerB,
*syncOptions.bPath,
@@ -179,7 +179,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
grpcDialOption,
filerB,
*syncOptions.bPath,
- strings.Split(*syncOptions.bExcludePaths, ","),
+ util.Split(*syncOptions.bExcludePaths, ","),
*syncOptions.bProxyByFiler,
filerA,
*syncOptions.aPath,
diff --git a/weed/util/fullpath.go b/weed/util/fullpath.go
index f52d4d1d01..92580dc384 100644
--- a/weed/util/fullpath.go
+++ b/weed/util/fullpath.go
@@ -63,3 +63,9 @@ func Join(names ...string) string {
func JoinPath(names ...string) FullPath {
return FullPath(Join(names...))
}
+func Split(separatedValues string, sep string) []string {
+ if separatedValues == "" {
+ return nil
+ }
+ return strings.Split(separatedValues, sep)
+}