mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-22 16:43:35 +08:00
fresh filer store bootstrap from the oldest peer
This commit is contained in:
@@ -151,7 +151,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
|
||||
// TODO deprecated, will be be removed after 2020-12-31
|
||||
// replaced by https://github.com/chrislusf/seaweedfs/wiki/Path-Specific-Configuration
|
||||
// fs.filer.FsyncBuckets = v.GetStringSlice("filer.options.buckets_fsync")
|
||||
fs.filer.LoadConfiguration(v)
|
||||
isFresh := fs.filer.LoadConfiguration(v)
|
||||
|
||||
notification.LoadConfiguration(v, "notification.")
|
||||
|
||||
@@ -165,8 +165,14 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
|
||||
}
|
||||
|
||||
existingNodes := fs.filer.ListExistingPeerUpdates()
|
||||
|
||||
fs.filer.AggregateFromPeers(option.Host, existingNodes)
|
||||
startFromTime := time.Now().Add(-filer.LogFlushInterval)
|
||||
if isFresh {
|
||||
glog.V(0).Infof("%s bootstrap from peers %+v", option.Host, existingNodes)
|
||||
if err := fs.filer.MaybeBootstrapFromPeers(option.Host, existingNodes, startFromTime); err == nil {
|
||||
glog.Fatalf("%s bootstrap from %+v", option.Host, existingNodes)
|
||||
}
|
||||
}
|
||||
fs.filer.AggregateFromPeers(option.Host, existingNodes, startFromTime)
|
||||
|
||||
fs.filer.LoadBuckets()
|
||||
|
||||
|
Reference in New Issue
Block a user