aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-10-31 21:48:05 -0700
committerChris Lu <chris.lu@gmail.com>2018-10-31 21:48:05 -0700
commit6219a9ad1f0bb4efd3bee736285872b22aa6e352 (patch)
treedd647a3855460d649f32641b9f4440ebedb73603
parent4c97ff3717dc642fd2cad311a79df9ba266669cb (diff)
downloadseaweedfs-6219a9ad1f0bb4efd3bee736285872b22aa6e352.tar.xz
seaweedfs-6219a9ad1f0bb4efd3bee736285872b22aa6e352.zip
filer ordered notifications
-rw-r--r--weed/replication/sink/filersink/filer_sink.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/replication/sink/filersink/filer_sink.go b/weed/replication/sink/filersink/filer_sink.go
index e2974511a..60a1fa7d4 100644
--- a/weed/replication/sink/filersink/filer_sink.go
+++ b/weed/replication/sink/filersink/filer_sink.go
@@ -163,7 +163,11 @@ func (fs *FilerSink) UpdateEntry(key string, oldEntry, newEntry *filer_pb.Entry,
glog.V(0).Infof("oldEntry %+v, newEntry %+v, existingEntry: %+v", oldEntry, newEntry, existingEntry)
- if filer2.ETag(newEntry.Chunks) == filer2.ETag(existingEntry.Chunks) {
+ if existingEntry.Attributes.Mtime > newEntry.Attributes.Mtime {
+ // skip if already changed
+ // this usually happens when the messages are not ordered
+ glog.V(0).Infof("late updates %s", key)
+ } else if filer2.ETag(newEntry.Chunks) == filer2.ETag(existingEntry.Chunks) {
// skip if no change
// this usually happens when retrying the replication
glog.V(0).Infof("already replicated %s", key)