aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-04-14 13:35:01 -0700
committerchrislu <chris.lu@gmail.com>2022-04-14 13:35:01 -0700
commit1384529eb745b7d78153daf9e1dd1a51d225a621 (patch)
treef07c8df444ee085c4e99cc635aa717f95d087ec5
parent94ea10e504d31e9ff4f1956ff2c8cdbc975d0314 (diff)
downloadseaweedfs-1384529eb745b7d78153daf9e1dd1a51d225a621.tar.xz
seaweedfs-1384529eb745b7d78153daf9e1dd1a51d225a621.zip
Fix filer.backup deletes files in backup folder in incremental mode
fix https://github.com/chrislusf/seaweedfs/issues/2919
-rw-r--r--weed/command/filer_sync.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index 37ce2aa73..e3d3b97bc 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -267,7 +267,10 @@ func genProcessFunction(sourcePath string, targetPath string, dataSink sink.Repl
return nil
}
key := buildKey(dataSink, message, targetPath, sourceOldKey, sourcePath)
- return dataSink.DeleteEntry(key, message.OldEntry.IsDirectory, message.DeleteChunks, message.Signatures)
+ if !dataSink.IsIncremental() {
+ return dataSink.DeleteEntry(key, message.OldEntry.IsDirectory, message.DeleteChunks, message.Signatures)
+ }
+ return nil
}
// handle new entries