From c6dec11ea556b8be648f372dfa5cbd074c9f631b Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 16 Jul 2024 09:38:10 -0700 Subject: [PATCH] [filer.sync] skip overwriting existing fresh entry --- weed/replication/sink/filersink/filer_sink.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/replication/sink/filersink/filer_sink.go b/weed/replication/sink/filersink/filer_sink.go index ce2de41b9..49f6877a0 100644 --- a/weed/replication/sink/filersink/filer_sink.go +++ b/weed/replication/sink/filersink/filer_sink.go @@ -120,6 +120,10 @@ func (fs *FilerSink) CreateEntry(key string, entry *filer_pb.Entry, signatures [ glog.V(3).Infof("already replicated %s", key) return nil } + if resp.Entry.Attributes != nil && resp.Entry.Attributes.Mtime >= entry.Attributes.Mtime { + glog.V(3).Infof("skip overwriting %s", key) + return nil + } } replicatedChunks, err := fs.replicateChunks(entry.GetChunks(), key)