aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_sync.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-08-10 10:01:57 -0700
committerchrislu <chris.lu@gmail.com>2024-08-10 10:01:57 -0700
commit7438648d1cfacd5ca570dd029d1bdb5fd271bd70 (patch)
treecf12b49473be0373cb03d83470ddc75708454171 /weed/command/filer_sync.go
parent49893267e978cc3fda00dc991e00099742fb5a9d (diff)
parent63c707f9c1b4dc469ec39c446563c324ce4ccb6f (diff)
downloadseaweedfs-7438648d1cfacd5ca570dd029d1bdb5fd271bd70.tar.xz
seaweedfs-7438648d1cfacd5ca570dd029d1bdb5fd271bd70.zip
Merge branch 'master' into mq
Diffstat (limited to 'weed/command/filer_sync.go')
-rw-r--r--weed/command/filer_sync.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index 9ad76e31b..90204af4a 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -118,7 +118,7 @@ var cmdFilerSynchronize = &Command{
func runFilerSynchronize(cmd *Command, args []string) bool {
- util.LoadConfiguration("security", false)
+ util.LoadSecurityConfiguration()
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
grace.SetupProfiling(*syncCpuProfile, *syncMemProfile)
@@ -296,12 +296,17 @@ func doSubscribeFilerMetaChanges(clientId int32, clientEpoch int32, grpcDialOpti
return setOffset(grpcDialOption, targetFiler, getSignaturePrefixByPath(sourcePath), sourceFilerSignature, offsetTsNs)
})
+ prefix := sourcePath
+ if !strings.HasSuffix(prefix, "/") {
+ prefix = prefix + "/"
+ }
+
metadataFollowOption := &pb.MetadataFollowOption{
ClientName: clientName,
ClientId: clientId,
ClientEpoch: clientEpoch,
SelfSignature: targetFilerSignature,
- PathPrefix: sourcePath,
+ PathPrefix: prefix,
AdditionalPathPrefixes: nil,
DirectoriesToWatch: nil,
StartTsNs: sourceFilerOffsetTsNs,
@@ -469,14 +474,14 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
}
} else {
- // new key is outside of the watched directory
+ // new key is outside the watched directory
if doDeleteFiles {
key := buildKey(dataSink, message, targetPath, sourceOldKey, sourcePath)
return dataSink.DeleteEntry(key, message.OldEntry.IsDirectory, message.DeleteChunks, message.Signatures)
}
}
} else {
- // old key is outside of the watched directory
+ // old key is outside the watched directory
if strings.HasPrefix(string(sourceNewKey), sourcePath) {
// new key is in the watched directory
key := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
@@ -486,7 +491,7 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
return nil
}
} else {
- // new key is also outside of the watched directory
+ // new key is also outside the watched directory
// skip
}
}