From b9d32d32e15e6726c8ec74cb3ab7a06bcc5d042f Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Sat, 6 Jan 2024 23:02:16 +0500 Subject: [PATCH 1/2] chore: filer sync add doDeleteFiles option for create only mode (#5166) --- weed/command/filer_sync.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go index 33dcf4073..b1e32b65e 100644 --- a/weed/command/filer_sync.go +++ b/weed/command/filer_sync.go @@ -47,6 +47,8 @@ type SyncOptions struct { metricsHttpIp *string metricsHttpPort *int concurrency *int + aDoDeleteFiles *bool + bDoDeleteFiles *bool clientId int32 clientEpoch int32 } @@ -90,6 +92,8 @@ func init() { syncMemProfile = cmdFilerSynchronize.Flag.String("memprofile", "", "memory profile output file") syncOptions.metricsHttpIp = cmdFilerSynchronize.Flag.String("metricsIp", "", "metrics listen ip") syncOptions.metricsHttpPort = cmdFilerSynchronize.Flag.Int("metricsPort", 0, "metrics listen port") + syncOptions.aDoDeleteFiles = cmdFilerSynchronize.Flag.Bool("a.doDeleteFiles", true, "delete and update files when synchronizing on filer A") + syncOptions.bDoDeleteFiles = cmdFilerSynchronize.Flag.Bool("b.doDeleteFiles", true, "delete and update files when synchronizing on filer B") syncOptions.clientId = util.RandomInt32() } @@ -164,6 +168,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool { *syncOptions.bDiskType, *syncOptions.bDebug, *syncOptions.concurrency, + *syncOptions.bDoDeleteFiles, aFilerSignature, bFilerSignature) if err != nil { @@ -201,6 +206,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool { *syncOptions.aDiskType, *syncOptions.aDebug, *syncOptions.concurrency, + *syncOptions.aDoDeleteFiles, bFilerSignature, aFilerSignature) if err != nil { @@ -233,7 +239,7 @@ func initOffsetFromTsMs(grpcDialOption grpc.DialOption, targetFiler pb.ServerAdd } func doSubscribeFilerMetaChanges(clientId int32, clientEpoch int32, grpcDialOption grpc.DialOption, sourceFiler pb.ServerAddress, sourcePath string, sourceExcludePaths []string, sourceReadChunkFromFiler bool, targetFiler pb.ServerAddress, targetPath string, - replicationStr, collection string, ttlSec int, sinkWriteChunkByFiler bool, diskType string, debug bool, concurrency int, sourceFilerSignature int32, targetFilerSignature int32) error { + replicationStr, collection string, ttlSec int, sinkWriteChunkByFiler bool, diskType string, debug bool, concurrency int, doDeleteFiles bool, sourceFilerSignature int32, targetFilerSignature int32) error { // if first time, start from now // if has previously synced, resume from that point of time @@ -251,7 +257,7 @@ func doSubscribeFilerMetaChanges(clientId int32, clientEpoch int32, grpcDialOpti filerSink.DoInitialize(targetFiler.ToHttpAddress(), targetFiler.ToGrpcAddress(), targetPath, replicationStr, collection, ttlSec, diskType, grpcDialOption, sinkWriteChunkByFiler) filerSink.SetSourceFiler(filerSource) - persistEventFn := genProcessFunction(sourcePath, targetPath, sourceExcludePaths, nil, filerSink, true, debug) + persistEventFn := genProcessFunction(sourcePath, targetPath, sourceExcludePaths, nil, filerSink, doDeleteFiles, debug) processEventFn := func(resp *filer_pb.SubscribeMetadataResponse) error { message := resp.EventNotification From 8ae00e47a6e3adf340cbf00269cebec2dad5ba5e Mon Sep 17 00:00:00 2001 From: chrislu Date: Mon, 8 Jan 2024 00:04:49 -0800 Subject: [PATCH 2/2] 3.61 --- k8s/charts/seaweedfs/Chart.yaml | 4 ++-- weed/util/constants.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s/charts/seaweedfs/Chart.yaml b/k8s/charts/seaweedfs/Chart.yaml index 3f349182a..321c02336 100644 --- a/k8s/charts/seaweedfs/Chart.yaml +++ b/k8s/charts/seaweedfs/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 description: SeaweedFS name: seaweedfs -appVersion: "3.60" -version: 3.60.1 +appVersion: "3.61" +version: 3.61.0 diff --git a/weed/util/constants.go b/weed/util/constants.go index a3c1beffd..185f5248e 100644 --- a/weed/util/constants.go +++ b/weed/util/constants.go @@ -5,7 +5,7 @@ import ( ) var ( - VERSION_NUMBER = fmt.Sprintf("%.02f", 3.60) + VERSION_NUMBER = fmt.Sprintf("%.02f", 3.61) VERSION = sizeLimit + " " + VERSION_NUMBER COMMIT = "" )