Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

add self filer

Chris Lu30dc365cbdb4
diff --git a/weed/filer/filer.go b/weed/filer/filer.go
index d131fe07e3..acbe634861 100644
--- a/weed/filer/filer.go
+++ b/weed/filer/filer.go
@@ -62,9 +62,16 @@ func NewFiler(masters []string, grpcDialOption grpc.DialOption,
func (f *Filer) AggregateFromPeers(self string, filers []string) {
// set peers
- if len(filers) == 0 {
+ found := false
+ for _, peer := range filers {
+ if peer == self {
+ found = true
+ }
+ }
+ if !found {
filers = append(filers, self)
}
+
f.MetaAggregator = NewMetaAggregator(filers, f.GrpcDialOption)
f.MetaAggregator.StartLoopSubscribe(f, self)