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
FUSE: subcribe meta events based on timestamp
Chris Lu2a7957b4ca83
diff --git a/weed/filesys/meta_cache/meta_cache_subscribe.go b/weed/filesys/meta_cache/meta_cache_subscribe.goindex da3085fcb3..3ba8c9f937 100644--- a/weed/filesys/meta_cache/meta_cache_subscribe.go+++ b/weed/filesys/meta_cache/meta_cache_subscribe.go@@ -12,7 +12,7 @@ import ("github.com/chrislusf/seaweedfs/weed/util")-func SubscribeMetaEvents(mc *MetaCache, client filer_pb.FilerClient, dir string) error {+func SubscribeMetaEvents(mc *MetaCache, client filer_pb.FilerClient, dir string, lastTsNs int64) error {processEventFn := func(resp *filer_pb.SubscribeMetadataResponse) error {message := resp.EventNotification@@ -36,7 +36,6 @@ func SubscribeMetaEvents(mc *MetaCache, client filer_pb.FilerClient, dir string)return err}- var lastTsNs int64for {err := client.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {stream, err := client.SubscribeMetadata(context.Background(), &filer_pb.SubscribeMetadataRequest{diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.goindex de1fb1d2ef..e7d1766b69 100644--- a/weed/filesys/wfs.go+++ b/weed/filesys/wfs.go@@ -95,10 +95,11 @@ func NewSeaweedFileSystem(option *Option) *WFS {}if wfs.option.AsyncMetaDataCaching {wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.CacheDir, "meta"))+ startTime := time.Now()if err := meta_cache.InitMetaCache(wfs.metaCache, wfs, wfs.option.FilerMountRootPath); err != nil{glog.V(0).Infof("failed to init meta cache: %v", err)} else {- go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs, wfs.option.FilerMountRootPath)+ go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs, wfs.option.FilerMountRootPath, startTime.UnixNano())util.OnInterrupt(func() {wfs.metaCache.Shutdown()})