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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
Fix Filer Sync Issue: 5455 (#5663)
MeenakshiSachdeva1caa012a766d
diff --git a/weed/command/filer.go b/weed/command/filer.goindex 1d8a6c4b80..877c4b5d59 100644--- a/weed/command/filer.go+++ b/weed/command/filer.go@@ -63,6 +63,7 @@ type FilerOptions struct {diskType *stringallowedOrigins *stringexposeDirectoryData *bool+ joinExistingFiler *bool}func init() {@@ -95,6 +96,7 @@ func init() {f.diskType = cmdFiler.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")f.allowedOrigins = cmdFiler.Flag.String("allowedOrigins", "*", "comma separated list of allowed origins")f.exposeDirectoryData = cmdFiler.Flag.Bool("exposeDirectoryData", true, "whether to return directory metadata and content in Filer UI")+ f.joinExistingFiler = cmdFiler.Flag.Bool("joinExistingFiler", false, "enable if new filer wants to join existing cluster")// start s3 on filerfilerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")@@ -262,6 +264,7 @@ func (fo *FilerOptions) startFiler() {DownloadMaxBytesPs: int64(*fo.downloadMaxMBps) * 1024 * 1024,DiskType: *fo.diskType,AllowedOrigins: strings.Split(*fo.allowedOrigins, ","),+ JoinExistingFiler: *fo.joinExistingFiler,})if nfs_err != nil {glog.Fatalf("Filer startup error: %v", nfs_err)diff --git a/weed/server/filer_server.go b/weed/server/filer_server.goindex ec1dff445b..795cd3ccc7 100644--- a/weed/server/filer_server.go+++ b/weed/server/filer_server.go@@ -74,6 +74,7 @@ type FilerOption struct {DiskType stringAllowedOrigins []stringExposeDirectoryData bool+ JoinExistingFiler bool}type FilerServer struct {@@ -197,6 +198,9 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)existingNodes := fs.filer.ListExistingPeerUpdates()startFromTime := time.Now().Add(-filer.LogFlushInterval)+ if option.JoinExistingFiler {+ startFromTime = time.Time{}+ }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 {