From 51376b584b09030f97fee87dd317ca587095aa45 Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Wed, 2 Nov 2022 13:32:49 +0100 Subject: [PATCH 1/3] add option to configure max_acquire_lock_cycles --- go.mod | 2 +- go.sum | 4 ++-- services/storage-users/pkg/config/config.go | 3 ++- services/storage-users/pkg/config/defaults/defaultconfig.go | 1 + services/storage-users/pkg/revaconfig/user.go | 2 ++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 14fe395f11..8bf9e2b2cf 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/blevesearch/bleve/v2 v2.3.5 github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965 - github.com/cs3org/reva/v2 v2.10.1-0.20221028083225-fdea5de75e96 + github.com/cs3org/reva/v2 v2.10.1-0.20221103130432-65012c8466b4 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index e48219ed27..ee0ceeb091 100644 --- a/go.sum +++ b/go.sum @@ -342,8 +342,8 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965 h1:y4n2j68LLnvac+zw/al8MfPgO5aQiIwLmHM/JzYN8AM= github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.10.1-0.20221028083225-fdea5de75e96 h1:zirPCF7XxGpWh/ZN2MES3muW2dzasjhUTOPUj0KoB9s= -github.com/cs3org/reva/v2 v2.10.1-0.20221028083225-fdea5de75e96/go.mod h1:Gv4tlxYM4wGKP8DD/S/TVsv619Z00QpsFbTR/2wfjVw= +github.com/cs3org/reva/v2 v2.10.1-0.20221103130432-65012c8466b4 h1:tJTOa/Tp0rXBWXsBTZE8P3O8+BLQIUhZiw0zkDA/S3I= +github.com/cs3org/reva/v2 v2.10.1-0.20221103130432-65012c8466b4/go.mod h1:Gv4tlxYM4wGKP8DD/S/TVsv619Z00QpsFbTR/2wfjVw= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index c98c4b0944..649a06a6cc 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -95,7 +95,8 @@ type OCISDriver struct { // the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}` GeneralSpaceAliasTemplate string `yaml:"generalspacealias_template" env:"STORAGE_USERS_OCIS_GENERAL_SPACE_ALIAS_TEMPLATE" desc:"Template string to construct general space aliases."` //ShareFolder defines the name of the folder jailing all shares - ShareFolder string `yaml:"share_folder" env:"STORAGE_USERS_OCIS_SHARE_FOLDER" desc:"Name of the folder jailing all shares."` + ShareFolder string `yaml:"share_folder" env:"STORAGE_USERS_OCIS_SHARE_FOLDER" desc:"Name of the folder jailing all shares."` + MaxAcquireLockCycles int `yaml:"max_acquire_lock_cycles" env:"STORAGE_USERS_OCIS_MAX_ACQUIRE_LOCK_CYCLES" desc:"Defines how often the system tries to acquire a lock before failing."` } type S3NGDriver struct { diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index 9fbd3e0fa1..66c1be9031 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -71,6 +71,7 @@ func DefaultConfig() *config.Config { PersonalSpaceAliasTemplate: "{{.SpaceType}}/{{.User.Username | lower}}", GeneralSpaceAliasTemplate: "{{.SpaceType}}/{{.SpaceName | replace \" \" \"-\" | lower}}", PermissionsEndpoint: "127.0.0.1:9191", + MaxAcquireLockCycles: 25, }, }, Events: config.Events{ diff --git a/services/storage-users/pkg/revaconfig/user.go b/services/storage-users/pkg/revaconfig/user.go index 1d1899f305..0c53f8951a 100644 --- a/services/storage-users/pkg/revaconfig/user.go +++ b/services/storage-users/pkg/revaconfig/user.go @@ -96,6 +96,7 @@ func UserDrivers(cfg *config.Config) map[string]interface{} { "treesize_accounting": true, "permissionssvc": cfg.Drivers.OCIS.PermissionsEndpoint, "permissionssvc_tls_mode": cfg.Commons.GRPCClientTLS.Mode, + "max_acquire_lock_cycles": cfg.Drivers.OCIS.MaxAcquireLockCycles, }, "s3": map[string]interface{}{ "enable_home": false, @@ -121,6 +122,7 @@ func UserDrivers(cfg *config.Config) map[string]interface{} { "s3.secret_key": cfg.Drivers.S3NG.SecretKey, "s3.endpoint": cfg.Drivers.S3NG.Endpoint, "s3.bucket": cfg.Drivers.S3NG.Bucket, + "max_acquire_lock_cycles": cfg.Drivers.OCIS.MaxAcquireLockCycles, }, } } From 12c7308fdf8f0b93b44ec261ea71bd636bdf776d Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 3 Nov 2022 14:27:54 +0100 Subject: [PATCH 2/3] update envvar description Signed-off-by: jkoberg --- services/storage-users/pkg/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index 649a06a6cc..5fc019b95d 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -96,7 +96,7 @@ type OCISDriver struct { GeneralSpaceAliasTemplate string `yaml:"generalspacealias_template" env:"STORAGE_USERS_OCIS_GENERAL_SPACE_ALIAS_TEMPLATE" desc:"Template string to construct general space aliases."` //ShareFolder defines the name of the folder jailing all shares ShareFolder string `yaml:"share_folder" env:"STORAGE_USERS_OCIS_SHARE_FOLDER" desc:"Name of the folder jailing all shares."` - MaxAcquireLockCycles int `yaml:"max_acquire_lock_cycles" env:"STORAGE_USERS_OCIS_MAX_ACQUIRE_LOCK_CYCLES" desc:"Defines how often the system tries to acquire a lock before failing."` + MaxAcquireLockCycles int `yaml:"max_acquire_lock_cycles" env:"STORAGE_USERS_OCIS_MAX_ACQUIRE_LOCK_CYCLES" desc:"When trying to lock files, ocis will try this amount of times to acquire the lock before failing. After each try it will wait for an increasing amount of time. Values of 0 or below will be ignored and the default value of 25 will be used"` } type S3NGDriver struct { From 27a1ab7612981ce5f257f3e5112e258d618038ee Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 3 Nov 2022 14:31:13 +0100 Subject: [PATCH 3/3] changelog Signed-off-by: jkoberg --- changelog/unreleased/configurable-max-lock-cycles.md | 5 +++++ changelog/unreleased/update-reva-rc1.md | 1 + 2 files changed, 6 insertions(+) create mode 100644 changelog/unreleased/configurable-max-lock-cycles.md diff --git a/changelog/unreleased/configurable-max-lock-cycles.md b/changelog/unreleased/configurable-max-lock-cycles.md new file mode 100644 index 0000000000..25b78ec72e --- /dev/null +++ b/changelog/unreleased/configurable-max-lock-cycles.md @@ -0,0 +1,5 @@ +Enhancement: Configurable max lock cycles + +Adds config option for max lock cycles. Also bumps reva + +https://github.com/owncloud/ocis/pull/4964 diff --git a/changelog/unreleased/update-reva-rc1.md b/changelog/unreleased/update-reva-rc1.md index a37e76c96b..fea49fe765 100644 --- a/changelog/unreleased/update-reva-rc1.md +++ b/changelog/unreleased/update-reva-rc1.md @@ -11,3 +11,4 @@ https://github.com/owncloud/ocis/pull/4867 https://github.com/owncloud/ocis/pull/4903 https://github.com/owncloud/ocis/pull/4908 https://github.com/owncloud/ocis/pull/4915 +https://github.com/owncloud/ocis/pull/4964