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] 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 a99b26b70..a8921f982 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 d441dc6fe..9ee58a397 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 a716f5003..6b20fc2b0 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,