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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add additionalPathPrefixes
Chris Lu68ea99190f37
diff --git a/unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.go b/unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.goindex c521ce33ed..b89e8de514 100644--- a/unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.go+++ b/unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.go@@ -72,8 +72,7 @@ func startGenerateMetadata() {func startSubscribeMetadata(eachEntryFunc func(event *filer_pb.SubscribeMetadataResponse) error) {- tailErr := pb.FollowMetadata(*tailFiler, grpc.WithInsecure(), "tail",- *dir, 0, 0, eachEntryFunc, false)+ tailErr := pb.FollowMetadata(*tailFiler, grpc.WithInsecure(), "tail", *dir, nil, 0, 0, eachEntryFunc, false)if tailErr != nil {fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)diff --git a/weed/command/filer_backup.go b/weed/command/filer_backup.goindex 0c450181b5..f0a4bd79b4 100644--- a/weed/command/filer_backup.go+++ b/weed/command/filer_backup.go@@ -112,7 +112,6 @@ func doFilerBackup(grpcDialOption grpc.DialOption, backupOption *FilerBackupOptireturn setOffset(grpcDialOption, sourceFiler, BackupKeyPrefix, int32(sinkId), lastTsNs)})- return pb.FollowMetadata(sourceFiler, grpcDialOption, "backup_"+dataSink.GetName(),- sourcePath, startFrom.UnixNano(), 0, processEventFnWithOffset, false)+ return pb.FollowMetadata(sourceFiler, grpcDialOption, "backup_"+dataSink.GetName(), sourcePath, nil, startFrom.UnixNano(), 0, processEventFnWithOffset, false)}diff --git a/weed/command/filer_meta_backup.go b/weed/command/filer_meta_backup.goindex 6fe323fbaa..ebc39beb10 100644--- a/weed/command/filer_meta_backup.go+++ b/weed/command/filer_meta_backup.go@@ -195,8 +195,7 @@ func (metaBackup *FilerMetaBackupOptions) streamMetadataBackup() error {return metaBackup.setOffset(lastTime)})- return pb.FollowMetadata(*metaBackup.filerAddress, metaBackup.grpcDialOption, "meta_backup",- *metaBackup.filerDirectory, startTime.UnixNano(), 0, processEventFnWithOffset, false)+ return pb.FollowMetadata(*metaBackup.filerAddress, metaBackup.grpcDialOption, "meta_backup", *metaBackup.filerDirectory, nil, startTime.UnixNano(), 0, processEventFnWithOffset, false)}diff --git a/weed/command/filer_meta_tail.go b/weed/command/filer_meta_tail.goindex 28c0db99be..3b30e2b6ab 100644--- a/weed/command/filer_meta_tail.go+++ b/weed/command/filer_meta_tail.go@@ -103,17 +103,15 @@ func runFilerMetaTail(cmd *Command, args []string) bool {}}- tailErr := pb.FollowMetadata(*tailFiler, grpcDialOption, "tail",- *tailTarget, time.Now().Add(-*tailStart).UnixNano(), 0,- func(resp *filer_pb.SubscribeMetadataResponse) error {- if !shouldPrint(resp) {- return nil- }- if err := eachEntryFunc(resp); err != nil {- return err- }+ tailErr := pb.FollowMetadata(*tailFiler, grpcDialOption, "tail", *tailTarget, nil, time.Now().Add(-*tailStart).UnixNano(), 0, func(resp *filer_pb.SubscribeMetadataResponse) error {+ if !shouldPrint(resp) {return nil- }, false)+ }+ if err := eachEntryFunc(resp); err != nil {+ return err+ }+ return nil+ }, false)if tailErr != nil {fmt.Printf("tail %s: %v\n", *tailFiler, tailErr)diff --git a/weed/command/filer_remote_sync.go b/weed/command/filer_remote_sync.goindex 8d27196607..fd6ed23b9d 100644--- a/weed/command/filer_remote_sync.go+++ b/weed/command/filer_remote_sync.go@@ -210,8 +210,7 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sourreturn setOffset(option.grpcDialOption, *option.filerAddress, RemoteSyncKeyPrefix, int32(dirHash), lastTsNs)})- return pb.FollowMetadata(*option.filerAddress, option.grpcDialOption,- "filer.remote.sync", mountedDir, lastOffsetTs.UnixNano(), 0, processEventFnWithOffset, false)+ return pb.FollowMetadata(*option.filerAddress, option.grpcDialOption, "filer.remote.sync", mountedDir, nil, lastOffsetTs.UnixNano(), 0, processEventFnWithOffset, false)}func toRemoteStorageLocation(mountDir, sourcePath util.FullPath, remoteMountLocation *remote_pb.RemoteStorageLocation) *remote_pb.RemoteStorageLocation {diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.goindex 5440811dda..4ebb87f718 100644--- a/weed/command/filer_sync.go+++ b/weed/command/filer_sync.go@@ -170,8 +170,7 @@ func doSubscribeFilerMetaChanges(grpcDialOption grpc.DialOption, sourceFiler, soreturn setOffset(grpcDialOption, targetFiler, SyncKeyPrefix, sourceFilerSignature, lastTsNs)})- return pb.FollowMetadata(sourceFiler, grpcDialOption, "syncTo_"+targetFiler,- sourcePath, sourceFilerOffsetTsNs, targetFilerSignature, processEventFnWithOffset, false)+ return pb.FollowMetadata(sourceFiler, grpcDialOption, "syncTo_"+targetFiler, sourcePath, nil, sourceFilerOffsetTsNs, targetFilerSignature, processEventFnWithOffset, false)}diff --git a/weed/pb/filer_pb_tail.go b/weed/pb/filer_pb_tail.goindex 31fb62fb37..63900081c9 100644--- a/weed/pb/filer_pb_tail.go+++ b/weed/pb/filer_pb_tail.go@@ -12,12 +12,12 @@ import (type ProcessMetadataFunc func(resp *filer_pb.SubscribeMetadataResponse) error-func FollowMetadata(filerAddress string, grpcDialOption grpc.DialOption,- clientName string, pathPrefix string, lastTsNs int64, selfSignature int32,+func FollowMetadata(filerAddress string, grpcDialOption grpc.DialOption, clientName string,+ pathPrefix string, additionalPathPrefixes []string, lastTsNs int64, selfSignature int32,processEventFn ProcessMetadataFunc, fatalOnError bool) error {- err := WithFilerClient(filerAddress, grpcDialOption, makeFunc(- clientName, pathPrefix, lastTsNs, selfSignature, processEventFn, fatalOnError))+ err := WithFilerClient(filerAddress, grpcDialOption, makeFunc(clientName,+ pathPrefix, additionalPathPrefixes, lastTsNs, selfSignature, processEventFn, fatalOnError))if err != nil {return fmt.Errorf("subscribing filer meta change: %v", err)}@@ -28,8 +28,7 @@ func WithFilerClientFollowMetadata(filerClient filer_pb.FilerClient,clientName string, pathPrefix string, lastTsNs int64, selfSignature int32,processEventFn ProcessMetadataFunc, fatalOnError bool) error {- err := filerClient.WithFilerClient(makeFunc(- clientName, pathPrefix, lastTsNs, selfSignature, processEventFn, fatalOnError))+ err := filerClient.WithFilerClient(makeFunc(clientName, pathPrefix, nil, lastTsNs, selfSignature, processEventFn, fatalOnError))if err != nil {return fmt.Errorf("subscribing filer meta change: %v", err)}@@ -37,16 +36,16 @@ func WithFilerClientFollowMetadata(filerClient filer_pb.FilerClient,return nil}-func makeFunc(clientName string, pathPrefix string, lastTsNs int64, selfSignature int32,- processEventFn ProcessMetadataFunc, fatalOnError bool) func(client filer_pb.SeaweedFilerClient) error {+func makeFunc(clientName string, pathPrefix string, additionalPathPrefixes []string, lastTsNs int64, selfSignature int32, processEventFn ProcessMetadataFunc, fatalOnError bool) func(client filer_pb.SeaweedFilerClient) error {return func(client filer_pb.SeaweedFilerClient) error {ctx, cancel := context.WithCancel(context.Background())defer cancel()stream, err := client.SubscribeMetadata(ctx, &filer_pb.SubscribeMetadataRequest{- ClientName: clientName,- PathPrefix: pathPrefix,- SinceNs: lastTsNs,- Signature: selfSignature,+ ClientName: clientName,+ PathPrefix: pathPrefix,+ PathPrefixes: additionalPathPrefixes,+ SinceNs: lastTsNs,+ Signature: selfSignature,})if err != nil {return fmt.Errorf("subscribe: %v", err)