diff options
| author | chrislu <chris.lu@gmail.com> | 2024-07-16 09:38:10 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-07-16 09:38:10 -0700 |
| commit | c6dec11ea556b8be648f372dfa5cbd074c9f631b (patch) | |
| tree | 25591873a307be9904be12ac6210c1a9090fc9af | |
| parent | 19d14b4c7160c2d555a795f7b6f74d2b45ab530c (diff) | |
| download | seaweedfs-c6dec11ea556b8be648f372dfa5cbd074c9f631b.tar.xz seaweedfs-c6dec11ea556b8be648f372dfa5cbd074c9f631b.zip | |
[filer.sync] skip overwriting existing fresh entry
| -rw-r--r-- | weed/replication/sink/filersink/filer_sink.go | 4 |
1 files changed, 4 insertions, 0 deletions
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) |
