[arvados] updated: 2.1.0-3217-g91550c635
git repository hosting
git at public.arvados.org
Tue Jan 17 21:59:31 UTC 2023
Summary of changes:
lib/config/config.default.yml | 3 +++
lib/config/export.go | 1 +
sdk/go/arvados/config.go | 1 +
sdk/python/tests/run_test_server.py | 1 +
services/api/app/controllers/application_controller.rb | 2 +-
.../app/controllers/arvados/v1/api_client_authorizations_controller.rb | 2 +-
services/api/app/controllers/arvados/v1/collections_controller.rb | 2 +-
services/api/app/controllers/arvados/v1/links_controller.rb | 2 +-
8 files changed, 10 insertions(+), 4 deletions(-)
via 91550c635ed37c0a79c17f276823b48433247c8a (commit)
from 6241cccaeba4413883699c360bde08e0e544a10e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 91550c635ed37c0a79c17f276823b48433247c8a
Author: Tom Clegg <tom at curii.com>
Date: Tue Jan 17 16:58:33 2023 -0500
18693: Use row locking only if enabled in config.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index 2d9119adf..357860652 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -288,6 +288,9 @@ Clusters:
# any user with "manage" permission can un-freeze.
UnfreezeProjectRequiresAdmin: false
+ # (Experimental) Use row-level locking on update API calls.
+ LockBeforeUpdate: false
+
Users:
# Config parameters to automatically setup new users. If enabled,
# this users will be able to self-activate. Enable this if you want
diff --git a/lib/config/export.go b/lib/config/export.go
index 069e300c5..b198a673e 100644
--- a/lib/config/export.go
+++ b/lib/config/export.go
@@ -65,6 +65,7 @@ var whitelist = map[string]bool{
"API.FreezeProjectRequiresDescription": true,
"API.FreezeProjectRequiresProperties": true,
"API.FreezeProjectRequiresProperties.*": true,
+ "API.LockBeforeUpdate": false,
"API.KeepServiceRequestTimeout": false,
"API.MaxConcurrentRequests": false,
"API.MaxIndexDatabaseRead": false,
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index fbbcb78ec..c1646dd3a 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -112,6 +112,7 @@ type Cluster struct {
FreezeProjectRequiresDescription bool
FreezeProjectRequiresProperties StringSet
UnfreezeProjectRequiresAdmin bool
+ LockBeforeUpdate bool
}
AuditLogs struct {
MaxAge Duration
diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index 2bb20ca5d..a5f681c47 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -792,6 +792,7 @@ def setup_config():
"SystemRootToken": auth_token('system_user'),
"API": {
"RequestTimeout": "30s",
+ "LockBeforeUpdate": True,
},
"Login": {
"Test": {
diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 88679f4f3..cf7271bbf 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -480,7 +480,7 @@ class ApplicationController < ActionController::Base
@filters = []
@objects = nil
find_objects_for_index
- if with_lock
+ if with_lock && Rails.configuration.API.LockBeforeUpdate
@object = @objects.lock.first
else
@object = @objects.first
diff --git a/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb b/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb
index 8ff5520e3..da7e11cd9 100644
--- a/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb
+++ b/services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb
@@ -141,7 +141,7 @@ class Arvados::V1::ApiClientAuthorizationsController < ApplicationController
@filters = [['uuid', '=', uuid_param]]
find_objects_for_index
query = @objects
- if with_lock
+ if with_lock && Rails.configuration.API.LockBeforeUpdate
query = query.lock
end
@object = query.first
diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb
index d4860cce1..dc20d6ae7 100644
--- a/services/api/app/controllers/arvados/v1/collections_controller.rb
+++ b/services/api/app/controllers/arvados/v1/collections_controller.rb
@@ -82,7 +82,7 @@ class Arvados::V1::CollectionsController < ApplicationController
select_attrs = (@select || ["manifest_text"]) | ["portable_data_hash", "trash_at"]
model = Collection
- if with_lock
+ if with_lock && Rails.configuration.API.LockBeforeUpdate
model = model.lock
end
if c = model.
diff --git a/services/api/app/controllers/arvados/v1/links_controller.rb b/services/api/app/controllers/arvados/v1/links_controller.rb
index 32d005874..c956bfc9b 100644
--- a/services/api/app/controllers/arvados/v1/links_controller.rb
+++ b/services/api/app/controllers/arvados/v1/links_controller.rb
@@ -94,7 +94,7 @@ class Arvados::V1::LinksController < ApplicationController
# user or (b) its head_uuid is an object the current_user
# can_manage.
model = Link
- if with_lock
+ if with_lock && Rails.configuration.API.LockBeforeUpdate
model = model.lock
end
link = model.unscoped.where(uuid: params[:uuid]).first
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list