From d42034202d66ae10c71ae282365ad159ce3add22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 11 Feb 2025 15:13:40 +0100 Subject: [PATCH 1/2] Add option to disable the posix fs watcher --- services/storage-users/pkg/config/config.go | 1 + services/storage-users/pkg/config/defaults/defaultconfig.go | 1 + services/storage-users/pkg/revaconfig/drivers.go | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index a99b26b709..a8921f9825 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -205,6 +205,7 @@ type PosixDriver struct { EnableFSRevisions bool `yaml:"enable_fs_revisions" env:"STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS" desc:"Allow for generating revisions from changes done to the local storage. Note: This doubles the number of bytes stored on disk because a copy of the current revision is stored to be turned into a revision later."` + WatchFS bool `yaml:"watch_fs" env:"STORAGE_USERS_POSIX_WATCH_FS" desc:"Enable the filesystem watcher to detect changes to the filesystem. This is used to detect changes to the filesystem and update the metadata accordingly."` WatchType string `yaml:"watch_type" env:"STORAGE_USERS_POSIX_WATCH_TYPE" desc:"Type of the watcher to use for getting notified about changes to the filesystem. Currently available options are 'inotifywait' (default), 'gpfswatchfolder' and 'gpfsfileauditlogging'." introductionVersion:"6.0.0"` WatchPath string `yaml:"watch_path" env:"STORAGE_USERS_POSIX_WATCH_PATH" desc:"Path to the watch directory/file. Only applies to the 'gpfsfileauditlogging' and 'inotifywait' watcher, in which case it is the path of the file audit log file/base directory to watch." introductionVersion:"6.0.0"` WatchFolderKafkaBrokers string `yaml:"watch_folder_kafka_hosts" env:"STORAGE_USERS_POSIX_WATCH_FOLDER_KAFKA_BROKERS" desc:"Comma-separated list of kafka brokers to read the watchfolder events from." introductionVersion:"6.0.0"` diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index d441dc6fe5..9ee58a397d 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -147,6 +147,7 @@ func DefaultConfig() *config.Config { PermissionsEndpoint: "eu.opencloud.api.settings", AsyncUploads: true, ScanDebounceDelay: 1 * time.Second, + WatchFS: false, EnableFSRevisions: false, }, }, diff --git a/services/storage-users/pkg/revaconfig/drivers.go b/services/storage-users/pkg/revaconfig/drivers.go index a716f50030..6b20fc2b01 100644 --- a/services/storage-users/pkg/revaconfig/drivers.go +++ b/services/storage-users/pkg/revaconfig/drivers.go @@ -85,7 +85,7 @@ func Local(cfg *config.Config) map[string]interface{} { } // Posix is the config mapping for the Posix storage driver -func Posix(cfg *config.Config, enableFSWatch bool) map[string]interface{} { +func Posix(cfg *config.Config, enableFSScan bool) map[string]interface{} { return map[string]interface{}{ "root": cfg.Drivers.Posix.Root, "personalspacepath_template": cfg.Drivers.Posix.PersonalSpacePathTemplate, @@ -116,7 +116,8 @@ func Posix(cfg *config.Config, enableFSWatch bool) map[string]interface{} { }, "use_space_groups": cfg.Drivers.Posix.UseSpaceGroups, "enable_fs_revisions": cfg.Drivers.Posix.EnableFSRevisions, - "watch_fs": enableFSWatch, + "scan_fs": enableFSScan, + "watch_fs": cfg.Drivers.Posix.WatchFS, "watch_type": cfg.Drivers.Posix.WatchType, "watch_path": cfg.Drivers.Posix.WatchPath, "watch_folder_kafka_brokers": cfg.Drivers.Posix.WatchFolderKafkaBrokers, From 7a326c5fc73710c280c03862589a47d519e150ba Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Thu, 13 Feb 2025 13:09:36 +0100 Subject: [PATCH 2/2] Bump reva --- go.mod | 2 +- go.sum | 4 ++-- .../reva/v2/pkg/storage/fs/posix/options/options.go | 1 + .../opencloud-eu/reva/v2/pkg/storage/fs/posix/tree/tree.go | 2 ++ vendor/modules.txt | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index e8db3ec6c7..576ff9cc03 100644 --- a/go.mod +++ b/go.mod @@ -65,7 +65,7 @@ require ( github.com/onsi/ginkgo/v2 v2.22.2 github.com/onsi/gomega v1.36.2 github.com/open-policy-agent/opa v1.1.0 - github.com/opencloud-eu/reva/v2 v2.27.3-0.20250213085913-418bbbbeed54 + github.com/opencloud-eu/reva/v2 v2.27.3-0.20250213094151-e2328704b282 github.com/orcaman/concurrent-map v1.0.0 github.com/owncloud/libre-graph-api-go v1.0.5-0.20240829135935-80dc00d6f5ea github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 445ba06674..a44229b84f 100644 --- a/go.sum +++ b/go.sum @@ -860,8 +860,8 @@ github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= github.com/open-policy-agent/opa v1.1.0 h1:HMz2evdEMTyNqtdLjmu3Vyx06BmhNYAx67Yz3Ll9q2s= github.com/open-policy-agent/opa v1.1.0/go.mod h1:T1pASQ1/vwfTa+e2fYcfpLCvWgYtqtiUv+IuA/dLPQs= -github.com/opencloud-eu/reva/v2 v2.27.3-0.20250213085913-418bbbbeed54 h1:uxSuQctr5AewEerqsCx9GwdzpEv4PESwkg9nyd30X6U= -github.com/opencloud-eu/reva/v2 v2.27.3-0.20250213085913-418bbbbeed54/go.mod h1:kAdY6yRvrlyhiqLaOCYOz+fHPCl7X522eonD8cIiTVE= +github.com/opencloud-eu/reva/v2 v2.27.3-0.20250213094151-e2328704b282 h1:8/0R5f4uZONW6Rjq3dw1G1u7FpOqffU+4hO2c4N6d3Y= +github.com/opencloud-eu/reva/v2 v2.27.3-0.20250213094151-e2328704b282/go.mod h1:kAdY6yRvrlyhiqLaOCYOz+fHPCl7X522eonD8cIiTVE= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= diff --git a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/options/options.go b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/options/options.go index b2ee6f02bc..eea4bcea16 100644 --- a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/options/options.go +++ b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/options/options.go @@ -39,6 +39,7 @@ type Options struct { // a revision when the file is changed. EnableFSRevisions bool `mapstructure:"enable_fs_revisions"` + ScanFS bool `mapstructure:"scan_fs"` WatchFS bool `mapstructure:"watch_fs"` WatchType string `mapstructure:"watch_type"` WatchPath string `mapstructure:"watch_path"` diff --git a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/tree/tree.go b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/tree/tree.go index 7b75c66332..b8104933c4 100644 --- a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/tree/tree.go +++ b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/tree/tree.go @@ -144,6 +144,8 @@ func New(lu node.PathLookup, bs Blobstore, um usermapper.Mapper, trashbin *trash if o.WatchFS { go t.watcher.Watch(watchPath) go t.workScanQueue() + } + if o.ScanFS { go func() { _ = t.WarmupIDCache(o.Root, true, false) }() diff --git a/vendor/modules.txt b/vendor/modules.txt index 9423814dc8..76074ec2e3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1189,7 +1189,7 @@ github.com/open-policy-agent/opa/v1/types github.com/open-policy-agent/opa/v1/util github.com/open-policy-agent/opa/v1/util/decoding github.com/open-policy-agent/opa/v1/version -# github.com/opencloud-eu/reva/v2 v2.27.3-0.20250213085913-418bbbbeed54 +# github.com/opencloud-eu/reva/v2 v2.27.3-0.20250213094151-e2328704b282 ## explicit; go 1.23.1 github.com/opencloud-eu/reva/v2/cmd/revad/internal/grace github.com/opencloud-eu/reva/v2/cmd/revad/runtime