fix: harden posix conditional publish locking

Fail closed on unexpected advisory-lock errors instead of silently reducing
cross-process exclusion to a local mutex. Make local publish-slot waits honor
request cancellation. Move version snapshots under the publish lock so
concurrent versioned PUTs preserve publication order. Add regression coverage
for canceled lock waiters.

Also add an option to disable flock files and only rely on in process locking.
This commit is contained in:
Ben McClelland
2026-08-31 19:00:00 -07:00
parent 7a1a3e4775
commit 9a73e222ca
9 changed files with 250 additions and 53 deletions
+10
View File
@@ -655,6 +655,16 @@ ROOT_SECRET_ACCESS_KEY=
# NFS servers that may hang on this call.
#VGW_DISABLE_COPY_FILE_RANGE=false
# The VGW_DISABLE_OBJECT_LOCK_FILE option disables shared advisory lock files
# used for conditional object publishes. This can be necessary on filesystems
# that do not support advisory file locking. When enabled, conditional writes
# are atomic only within a single versitygw process and are unsafe with
# multiple gateway processes sharing the same backend.
# This can be set to true to disable the .vgwlocks directory if running in
# single versitygw instance mode or conditional writes are not important
# to this deployment.
#VGW_DISABLE_OBJECT_LOCK_FILE=false
# The VGW_ENABLE_O_DIRECT option enables best-effort O_DIRECT for object data
# reads and writes. This is disabled by default. When enabled, versitygw
# attempts to open object data files with O_DIRECT and automatically falls back