Browse Source

Merge pull request #3254 from shichanglin5/fix_subscribe_meta

[Critical] Avoid synchronizing from scratch due to err
pull/3256/head
Chris Lu 3 years ago
committed by GitHub
parent
commit
4ae9884a6e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      weed/filer/meta_aggregator.go

6
weed/filer/meta_aggregator.go

@ -100,7 +100,8 @@ func (ma *MetaAggregator) loopSubscribeToOnefiler(f *Filer, self pb.ServerAddres
} }
if err != nil { if err != nil {
glog.V(0).Infof("subscribing remote %s meta change: %v", peer, err) glog.V(0).Infof("subscribing remote %s meta change: %v", peer, err)
} else if lastTsNs < nextLastTsNs {
}
if lastTsNs < nextLastTsNs {
lastTsNs = nextLastTsNs lastTsNs = nextLastTsNs
} }
time.Sleep(1733 * time.Millisecond) time.Sleep(1733 * time.Millisecond)
@ -210,10 +211,9 @@ func (ma *MetaAggregator) doSubscribeToOneFiler(f *Filer, self pb.ServerAddress,
if err := processEventFn(resp); err != nil { if err := processEventFn(resp); err != nil {
return fmt.Errorf("process %v: %v", resp, err) return fmt.Errorf("process %v: %v", resp, err)
} }
lastTsNs = resp.TsNs
f.onMetadataChangeEvent(resp) f.onMetadataChangeEvent(resp)
lastTsNs = resp.TsNs
} }
}) })
return lastTsNs, err return lastTsNs, err

Loading…
Cancel
Save