aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_remote_sync_dir.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-07-12 11:17:28 -0700
committerchrislu <chris.lu@gmail.com>2024-07-12 11:17:30 -0700
commit3a82f5ffad3122a3adeb9e652cee72420a2f6f97 (patch)
treebc2df43aee7f59e8b183eadb52ef6b3fdce14e06 /weed/command/filer_remote_sync_dir.go
parentec9e7493b34df5c13462cdaeab5b35f152d0cb68 (diff)
downloadseaweedfs-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_remote_sync_dir.go')
-rw-r--r--weed/command/filer_remote_sync_dir.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go
index 42dc9ff28..186523e45 100644
--- a/weed/command/filer_remote_sync_dir.go
+++ b/weed/command/filer_remote_sync_dir.go
@@ -64,12 +64,17 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour
option.clientEpoch++
+ prefix := mountedDir
+ if !strings.HasSuffix(prefix, "/") {
+ prefix = prefix + "/"
+ }
+
metadataFollowOption := &pb.MetadataFollowOption{
ClientName: "filer.remote.sync",
ClientId: option.clientId,
ClientEpoch: option.clientEpoch,
SelfSignature: 0,
- PathPrefix: mountedDir,
+ PathPrefix: prefix,
AdditionalPathPrefixes: []string{filer.DirectoryEtcRemote},
DirectoriesToWatch: nil,
StartTsNs: lastOffsetTs.UnixNano(),