diff options
| author | chrislu <chris.lu@gmail.com> | 2024-07-12 11:17:28 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-07-12 11:17:30 -0700 |
| commit | 3a82f5ffad3122a3adeb9e652cee72420a2f6f97 (patch) | |
| tree | bc2df43aee7f59e8b183eadb52ef6b3fdce14e06 /weed/command/filer_meta_backup.go | |
| parent | ec9e7493b34df5c13462cdaeab5b35f152d0cb68 (diff) | |
| download | seaweedfs-3a82f5ffad3122a3adeb9e652cee72420a2f6f97.tar.xz seaweedfs-3a82f5ffad3122a3adeb9e652cee72420a2f6f97.zip | |
ensure metadata follow a specific folder
fix https://github.com/seaweedfs/seaweedfs/issues/5774
Diffstat (limited to 'weed/command/filer_meta_backup.go')
| -rw-r--r-- | weed/command/filer_meta_backup.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/command/filer_meta_backup.go b/weed/command/filer_meta_backup.go index c47ccbd0c..6ed8c4c64 100644 --- a/weed/command/filer_meta_backup.go +++ b/weed/command/filer_meta_backup.go @@ -8,6 +8,7 @@ import ( "github.com/spf13/viper" "google.golang.org/grpc" "reflect" + "strings" "time" "github.com/seaweedfs/seaweedfs/weed/pb" @@ -197,12 +198,16 @@ func (metaBackup *FilerMetaBackupOptions) streamMetadataBackup() error { metaBackup.clientEpoch++ + prefix := *metaBackup.filerDirectory + if !strings.HasSuffix(prefix, "/") { + prefix = prefix + "/" + } metadataFollowOption := &pb.MetadataFollowOption{ ClientName: "meta_backup", ClientId: metaBackup.clientId, ClientEpoch: metaBackup.clientEpoch, SelfSignature: 0, - PathPrefix: *metaBackup.filerDirectory, + PathPrefix: prefix, AdditionalPathPrefixes: nil, DirectoriesToWatch: nil, StartTsNs: startTime.UnixNano(), |
